# 20260506184227_UpdateSubscriptionPlanIsUnlimitedTokens.Designer

- File ID: file:1psv1cv:20260506184227-updatesubscriptionplanisunlimited
- Path: NexusReader.Data/Migrations/20260506184227_UpdateSubscriptionPlanIsUnlimitedTokens.Designer.cs
- Role: database-config
- Layer: data

## Purpose

EF Core migration designer that builds the target EF Core model for the migration UpdateSubscriptionPlanIsUnlimitedTokens; contains the model snapshot/configuration (entities, properties, indexes, relations, and seed data) used by EF migrations.

## Key Details

This auto-generated migration designer configures schema details including vector columns (pgvector), identity defaults for Postgres, navigation and FK behaviors (cascade/restrict), and seeds four SubscriptionPlan rows — notably Enterprise has IsUnlimitedTokens = true and a very large AITokenLimit.

## Symbols

- UpdateSubscriptionPlanIsUnlimitedTokens: EF Core migration designer that builds the target EF Core model for the migration UpdateSubscriptionPlanIsUnlimitedTokens; contains the model snapshot/configuration (entities, properties, indexes, relations, and seed data) used by EF migrations.
- BuildTargetModel(): Constructs the EF Core model for this migration: configures entities, properties, constraints, relationships, annotations and seed data.
- Ebook: Represents an uploaded ebook file and metadata belonging to a user/tenant.
- KnowledgeUnit: Represents a chunk of semantic content with vector embedding and metadata for tenant/source.
- KnowledgeUnitLink: Represents a directed relation/link between knowledge units.
- NexusUser: Application user entity (extends IdentityUser style) with AI token tracking and subscription reference.
- QuizResult: Stores quiz completion results for a user and tenant.
- SemanticKnowledgeCache: Caches semantic embedding results with original text, model and tenant scoping.
- SubscriptionPlan: Represents subscription tiers including AI token limits and a flag for unlimited tokens; seeded with default plans.

## Dependencies

- No resolved dependencies.

## Calls

- No resolved calls.

## Unresolved References

- dependency-target: NexusReader.Data.Persistence/AppDbContext (referenced in [DbContext(typeof(AppDbContext))])

## Coverage

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

## Control Flow Fragments

- BuildTargetModel: 19 nodes, 18 edges, 0 jumps, 0 unsupported constructs

## Diagrams

### 20260506184227_UpdateSubscriptionPlanIsUnlimitedTokens.Designer Neighborhood

```mermaid
flowchart LR
    class_1jcp5tl_updatesubscriptionplanisunlimitedtokens("UpdateSubscriptionPlanIsUnlimitedTokens")
    file_1psv1cv_20260506184227_updatesubscriptionplanisunlimited("20260506184227_UpdateSubscriptionPlanIsUnlimitedTokens.Designer")
    method_e4n4cn_buildtargetmodel[["BuildTargetModel()"]]
    type_1djp2cc_subscriptionplan[/"SubscriptionPlan"/]
    type_4o1nar_semanticknowledgecache[/"SemanticKnowledgeCache"/]
    type_5xf7z1_knowledgeunitlink[/"KnowledgeUnitLink"/]
    type_bldst0_nexususer[/"NexusUser"/]
    type_brf3z8_knowledgeunit[/"KnowledgeUnit"/]
    type_d7ymkn_quizresult[/"QuizResult"/]
    type_mdf15q_ebook[/"Ebook"/]
```

### 20260506184227_UpdateSubscriptionPlanIsUnlimitedTokens.Designer Execution Overview

```mermaid
flowchart TD
    class_1jcp5tl_updatesubscriptionplanisunlimitedtokens("UpdateSubscriptionPlanIsUnlimitedTokens")
    method_e4n4cn_buildtargetmodel[["BuildTargetModel()"]]
    class_1jcp5tl_updatesubscriptionplanisunlimitedtokens -->|contains| method_e4n4cn_buildtargetmodel
```

## Diagram Validation

- Status: pass
