# 20260510151022_NormalizeAuthor.Designer

- File ID: file:1jljncb:20260510151022-normalizeauthor-designer-cs
- Path: NexusReader.Data/Migrations/20260510151022_NormalizeAuthor.Designer.cs
- Role: database-config
- Layer: data

## Purpose

EF Core migration designer snapshot that defines the target database model for the "NormalizeAuthor" migration: maps entities, properties, keys, indices, relationships, and seed data used by migrations at runtime.

## Key Details

This auto-generated migration designer captures the complete EF Core model snapshot for the NormalizeAuthor migration: it configures Postgres vector extension, identity defaults, entity schemas, FK relationships and seeds subscription plans (Free/Basic/Pro/Enterprise).

## Symbols

- NormalizeAuthor: EF Core migration designer snapshot that defines the target database model for the "NormalizeAuthor" migration: maps entities, properties, keys, indices, relationships, and seed data used by migrations at runtime.
- BuildTargetModel(): Builds the EF Core model snapshot for this migration: adds annotations, DB extensions, defines all entity mappings (tables, columns, keys, indices), relationships, navigations, and seed data.
- Author: Represents an ebook author; mapped to Authors table.
- Ebook: Represents an ebook record with owner, author, and tenant scoping.
- KnowledgeUnit: Stores extracted semantic units with vector embeddings for similarity search.
- KnowledgeUnitLink: Represents directed relations between knowledge units.
- NexusUser: Application user record mapped to AspNetUsers with tenant and subscription data.
- SubscriptionPlan: Represents subscription tiers and token limits; seeded with default plans.
- SemanticKnowledgeCache: Caches computed semantic responses and embedding vector for quick retrieval.
- QuizResult: Stores quiz results per user and tenant.

## Dependencies

- No resolved dependencies.

## Calls

- No resolved calls.

## Unresolved References

- dependency-target: NexusReader.Data.Persistence (AppDbContext reference via attribute)
- dependency-target: Npgsql.EntityFrameworkCore.PostgreSQL (extension usage)
- dependency-target: Pgvector (Vector type usage)

## Coverage

- Symbols: 10
- Executable symbols: 1
- Executable symbols with control flow: 1
- Grounded edges: 10
- Unresolved references: 3
- Control-flow fragments: 1
- Unresolved jumps: 0
- Unsupported constructs: 0
- Control-flow coverage: 100%
- Required diagrams: 2
- Generated diagrams: 2

## Control Flow Fragments

- BuildTargetModel: 14 nodes, 14 edges, 0 jumps, 0 unsupported constructs

## Diagrams

### 20260510151022_NormalizeAuthor.Designer Neighborhood

```mermaid
flowchart LR
    class_1l7wkbd_normalizeauthor("NormalizeAuthor")
    file_1jljncb_20260510151022_normalizeauthor_designer_cs("20260510151022_NormalizeAuthor.Designer")
    method_b38ztv_buildtargetmodel[["BuildTargetModel()"]]
    type_16wzuux_nexususer[/"NexusUser"/]
    type_19fc1gq_ebook[/"Ebook"/]
    type_1nn41cx_knowledgeunitlink[/"KnowledgeUnitLink"/]
    type_1trrs3x_author[/"Author"/]
    type_brf48c_subscriptionplan[/"SubscriptionPlan"/]
    type_mla8ro_knowledgeunit[/"KnowledgeUnit"/]
    type_n866i0_quizresult[/"QuizResult"/]
    type_nk74zf_semanticknowledgecache[/"SemanticKnowledgeCache"/]
```

### 20260510151022_NormalizeAuthor.Designer Execution Overview

```mermaid
flowchart TD
    class_1l7wkbd_normalizeauthor("NormalizeAuthor")
    method_b38ztv_buildtargetmodel[["BuildTargetModel()"]]
    class_1l7wkbd_normalizeauthor -->|contains| method_b38ztv_buildtargetmodel
```

## Diagram Validation

- Status: pass
