PlotDirector/PlotLine/Services/ProjectBackupStoredFieldContract.Schema.cs

116 lines
31 KiB
C#

namespace PlotLine.Services;
internal static partial class ProjectBackupStoredFieldContract
{
// Generated from the independently audited stored schema inventory.
// Update alongside stored columns/backup DTOs; specialist field-omission checks use live synthetic metadata.
private static readonly IReadOnlyDictionary<string,(string Columns,string Nullable)> StoredColumns=
new Dictionary<string,(string,string)>(StringComparer.OrdinalIgnoreCase)
{
["AssetAliases"]=("AssetAliasID,StoryAssetID,Alias,SortOrder,CreatedUtc",""),
["AssetCustodyCharacters"]=("AssetCustodyEventCharacterID,AssetCustodyEventID,CharacterID,CharacterNameText,CustodyRoleID","CharacterID,CharacterNameText"),
["AssetCustodyEvents"]=("AssetCustodyEventID,StoryAssetID,SceneID,AssetCustodyEventTypeID,Description,CreatedDate,UpdatedDate","Description"),
["AssetDependencies"]=("AssetDependencyID,SourceAssetID,TargetAssetID,AssetDependencyTypeID,SourceRequiredStateID,TargetBlockedStateID,Description,CreatedDate,UpdatedDate,IsArchived","SourceRequiredStateID,TargetBlockedStateID,Description"),
["AssetEvents"]=("AssetEventID,StoryAssetID,SceneID,AssetEventTypeID,FromStateID,ToStateID,EventTitle,EventDescription,CreatedDate,UpdatedDate,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC","FromStateID,ToStateID,EventDescription,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC"),
["AssetStates"]=("AssetStateID,ProjectID,AssetKindID,StateName,SortOrder,Description,IsResolvedState,IsActive","ProjectID,AssetKindID,Description"),
["AuthorPlotSeeds"]=("AuthorPlotSeedID,ProjectID,BookID,Description,Status,MatchedPlotLineID,Source,CreatedUtc,UpdatedUtc","MatchedPlotLineID"),
["Books"]=("BookID,ProjectID,BookTitle,BookNumber,Description,SortOrder,CreatedDate,UpdatedDate,IsArchived,ArchivedDate,ArchivedReason,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC,Subtitle,Tagline,ShortDescription,Status,TargetWordCount,WritingStartDate,TargetCompletionDate,PublicationDate,CoverThumbnailPath,CoverStandardPath,UsesExplicitScenes,StoryEra,PrimaryLocaleCode","Description,ArchivedDate,ArchivedReason,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC,Subtitle,Tagline,ShortDescription,TargetWordCount,WritingStartDate,TargetCompletionDate,PublicationDate,CoverThumbnailPath,CoverStandardPath,StoryEra,PrimaryLocaleCode"),
["ChapterGoals"]=("ChapterGoalID,ChapterID,GoalSummary,EmotionalGoal,ReaderTakeaway,MustInclude,RisksOrConcerns,CreatedDate,UpdatedDate,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC","GoalSummary,EmotionalGoal,ReaderTakeaway,MustInclude,RisksOrConcerns,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC"),
["Chapters"]=("ChapterID,BookID,ChapterNumber,ChapterTitle,POVCharacterID,Summary,SortOrder,RevisionStatusID,CreatedDate,UpdatedDate,IsArchived,ArchivedDate,ArchivedReason,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC,IsLinkedToManuscript,ManuscriptDocumentID,ExternalReference,LinkedUtc,ChapterPurposeID,POVSource,POVConfidence,POVEvidence,POVSuggestedName","POVCharacterID,Summary,ArchivedDate,ArchivedReason,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC,ManuscriptDocumentID,ExternalReference,LinkedUtc,ChapterPurposeID,POVSource,POVConfidence,POVEvidence,POVSuggestedName"),
["CharacterAliases"]=("CharacterAliasID,CharacterID,Alias,SortOrder,CreatedUtc",""),
["CharacterAttributeEvents"]=("CharacterAttributeEventID,CharacterID,CharacterAttributeTypeID,SceneID,AttributeValue,Description,CreatedDate,UpdatedDate","Description"),
["CharacterAttributeTypes"]=("CharacterAttributeTypeID,ProjectID,AttributeName,DataType,IsNormallyStable,SortOrder,IsActive","ProjectID"),
["CharacterEnrichmentEvidence"]=("CharacterEnrichmentEvidenceID,CharacterEnrichmentRunID,CharacterID,SceneID,FieldName,Value,Evidence,Confidence,Source,CreatedUtc","SceneID,Value,Evidence"),
["CharacterEnrichmentRuns"]=("CharacterEnrichmentRunID,ProjectID,BookID,UserID,StoryIntelligenceBookPipelineID,CharacterResolutionVersion,Status,TotalCharacters,ProcessedCharacters,CurrentStage,CurrentMessage,QueuedUtc,StartedUtc,CompletedUtc,FailedUtc,AttemptCount,Model,InputTokens,OutputTokens,TotalTokens,DurationMs,ErrorMessage,ErrorDetail,IsCurrent,UpdatedUtc,CharacterID","StoryIntelligenceBookPipelineID,CurrentStage,CurrentMessage,StartedUtc,CompletedUtc,FailedUtc,Model,InputTokens,OutputTokens,TotalTokens,DurationMs,ErrorMessage,ErrorDetail,CharacterID"),
["CharacterImages"]=("CharacterImageID,CharacterID,ProjectID,ImagePath,ThumbnailPath,Caption,SortOrder,UploadedDateUTC,IsDeleted,DeletedDateUTC","Caption,DeletedDateUTC"),
["CharacterIntelligenceEvidenceEvents"]=("CharacterIntelligenceEvidenceEventID,CharacterIntelligenceProfileID,SceneResultID,FieldName,PreviousValue,NewValue,Evidence,Confidence,IsContradiction,Source,CreatedUtc","PreviousValue,NewValue,Evidence"),
["CharacterIntelligenceProfiles"]=("CharacterIntelligenceProfileID,ImportSessionID,ProjectID,BookID,CanonicalIdentityKey,CanonicalName,ProfileJson,Confidence,NarrativeImportance,IsRecurring,EvidenceVersion,LastUpdatedSceneResultID,CreatedUtc,UpdatedUtc","NarrativeImportance,LastUpdatedSceneResultID"),
["CharacterKnowledge"]=("CharacterKnowledgeID,CharacterID,StoryAssetID,PlotThreadID,SceneID,KnowledgeStateID,SourceEventID,Description,CreatedDate,UpdatedDate,SourceReviewKey","StoryAssetID,PlotThreadID,SourceEventID,Description,SourceReviewKey"),
["CharacterRelationships"]=("CharacterRelationshipID,ProjectID,CharacterAID,CharacterBID,RelationshipTypeID,IsPermanent,StartSceneID,EndSceneID,IsKnownToReader,Notes,CreatedDate,UpdatedDate,IsArchived,ArchivedDate,ArchivedReason,IsInitialRelationship,InitialBookID,ReaderInitiallyKnows,InitialRelationshipStateID,InitialIntensity,IsReciprocal,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC","StartSceneID,EndSceneID,Notes,ArchivedDate,ArchivedReason,InitialBookID,InitialRelationshipStateID,InitialIntensity,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC"),
["Characters"]=("CharacterID,ProjectID,CharacterName,ShortName,Sex,BirthDate,AgeAtSeriesStart,AgeReferenceSceneID,Height,EyeColour,CharacterImportance,DefaultDescription,CreatedDate,UpdatedDate,IsArchived,ArchivedDate,ArchivedReason,ShowInQuickAddBar,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC,ImagePath,ThumbnailPath,AvatarSourceCharacterImageID,AvatarImagePath,AvatarThumbnailPath,SexValueID","ShortName,Sex,BirthDate,AgeAtSeriesStart,AgeReferenceSceneID,Height,EyeColour,CharacterImportance,DefaultDescription,ArchivedDate,ArchivedReason,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC,ImagePath,ThumbnailPath,AvatarSourceCharacterImageID,AvatarImagePath,AvatarThumbnailPath,SexValueID"),
["ContinuityWarningAcknowledgements"]=("ContinuityWarningAcknowledgementID,ProjectID,WarningType,SceneID,CharacterID,AssetID,AcknowledgedDate,AcknowledgedByUserID,Notes","SceneID,CharacterID,AssetID,AcknowledgedByUserID,Notes"),
["ContinuityWarnings"]=("ContinuityWarningID,ValidationRunID,ProjectID,BookID,ChapterID,SceneID,EntityType,EntityID,WarningTypeID,WarningSeverityID,Message,Details,IsDismissed,IsIntentional,CreatedDate,LastDetectedDate","ValidationRunID,BookID,ChapterID,SceneID,EntityID,Details"),
["CoreImportBasicLocationCandidates"]=("CoreImportBasicLocationCandidateID,CoreImportBasicLocationReviewID,StableKey,ProposedName,PreferredName,KnownNamesJson,ParentLocationID,ParentCandidateKey,ExistingLocationID,Action,SameAsLocationID,SameAsCandidateKey,ResultLocationID,FirstChapterNumber,FirstSceneNumber,FirstOccurrenceIndex,ObservationCount,SortOrder,CreatedUtc,UpdatedUtc","ParentLocationID,ParentCandidateKey,ExistingLocationID,SameAsLocationID,SameAsCandidateKey,ResultLocationID"),
["CoreImportBasicLocationEvidence"]=("CoreImportBasicLocationEvidenceID,CoreImportBasicLocationCandidateID,SceneID,ChapterID,ChapterNumber,SceneNumber,OccurrenceIndex,EvidenceText,SortOrder",""),
["CoreImportBasicLocationReviews"]=("CoreImportBasicLocationReviewID,PreviewID,UserID,ProjectID,BookID,BuildID,Status,RawObservationCount,CandidateCount,CreatedUtc,UpdatedUtc,CompletedUtc","BuildID,CompletedUtc"),
["FloorPlanBlocks"]=("FloorPlanBlockID,FloorPlanFloorID,LocationID,X,Y,WidthCells,HeightCells,BlockType,LabelOverride,Notes,CreatedDate,ModifiedDate","LabelOverride,Notes,ModifiedDate"),
["FloorPlanFloors"]=("FloorPlanFloorID,FloorPlanID,Name,SortOrder,GridWidth,GridHeight,CreatedDate,ModifiedDate,LocationID,BackgroundImagePath,BackgroundImageOriginalFileName,BackgroundOpacity,BackgroundScale,BackgroundOffsetX,BackgroundOffsetY,BackgroundLocked,Description","ModifiedDate,LocationID,BackgroundImagePath,BackgroundImageOriginalFileName,BackgroundOpacity,BackgroundScale,BackgroundOffsetX,BackgroundOffsetY,Description"),
["FloorPlanTransitions"]=("FloorPlanTransitionID,FloorPlanFloorID,FromLocationID,ToLocationID,TransitionType,Notes,IsLocked,DisplayLabel,CreatedDate,ModifiedDate,PositionWithinLocation","Notes,DisplayLabel,ModifiedDate"),
["FloorPlans"]=("FloorPlanID,ProjectID,Name,Description,CreatedDate,ModifiedDate,LocationID","Description,ModifiedDate,LocationID"),
["LocationAliases"]=("LocationAliasID,LocationID,Alias,SortOrder,CreatedUtc",""),
["LocationRelationships"]=("LocationRelationshipID,FromLocationID,ToLocationID,LocationRelationshipTypeID,IsBidirectional,Strength,CanHearNormalSpeech,CanHearLoudNoise,CanSeeMovement,CanSeeClearly,CanTravelDirectly,Notes,CreatedDate,UpdatedDate,IsArchived","Strength,Notes"),
["Locations"]=("LocationID,ProjectID,ParentLocationID,LocationName,LocationTypeID,Description,CreatedDate,UpdatedDate,IsArchived,ArchivedDate,ArchivedReason,ShowInQuickAddBar,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC,ExcludeFromCompanionDetection,DetectionPriority","ParentLocationID,LocationTypeID,Description,ArchivedDate,ArchivedReason,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC"),
["ManuscriptDocuments"]=("ManuscriptDocumentID,BookID,ProjectID,DocumentGuid,BindingVersion,CreatedUtc,LastSyncUtc,LastOpenedUtc,IsActive,CreatedByUserID","LastSyncUtc,LastOpenedUtc,CreatedByUserID"),
["ManuscriptStructuralChapterSources"]=("ChapterID,ProjectID,BookID,SourceText,SourceWordCount,SourceCharacterCount,ParagraphMapJson,CreatedUtc,UpdatedUtc,StructuralParsedJson,DefaultPovName,ExplicitNarratorName","ParagraphMapJson,StructuralParsedJson,DefaultPovName,ExplicitNarratorName"),
["MapFeatures"]=("MapID,FeatureID,Name,Type,GeometryClass,Layer,X,Y,Width,Height,Rotation,ZOrder,IsPlaced,IsProvisional,IsLocked,ShowLabel,LabelX,LabelY,LocationID,FloorPlanID,StartFeatureID,EndFeatureID,GeometryJson,Notes","LocationID,FloorPlanID,StartFeatureID,EndFeatureID,Notes"),
["MapJourneyNotes"]=("MapID,CharacterID,FromSceneID,ToSceneID,RouteFeatureID,TravelMethod,TypicalMinutes","RouteFeatureID,TravelMethod,TypicalMinutes"),
["MapReferenceImages"]=("ImageID,ProjectID,OriginalFileName,ContentType,Width,Height,ImageData",""),
["MapRelationships"]=("MapID,RelationshipID,SourceID,TargetID,Direction,RelativeDistance,MeasuredDistance,Unit,TypicalTravelTime,Notes","Direction,RelativeDistance,MeasuredDistance,Unit,TypicalTravelTime,Notes"),
["OnboardingManuscriptBuildChapterMap"]=("OnboardingManuscriptBuildID,TemporaryChapterKey,ChapterID",""),
["OnboardingManuscriptBuildCharacterMap"]=("OnboardingManuscriptBuildID,TemporaryCharacterKey,CharacterID,Created",""),
["OnboardingManuscriptBuildSceneMap"]=("OnboardingManuscriptBuildID,TemporarySceneKey,SceneID",""),
["OnboardingManuscriptBuilds"]=("OnboardingManuscriptBuildID,PreviewID,UserID,ProjectID,BookID,ManuscriptDocumentID,Status,MarkerStatus,ChaptersCreated,ScenesCreated,CharactersCreated,CharactersReused,SceneAppearancesCreated,CreatedUtc,UpdatedUtc,MarkerSyncMessage,MarkerSyncCompletedUtc","ManuscriptDocumentID,MarkerSyncMessage,MarkerSyncCompletedUtc"),
["PlotEventTargetPlotLines"]=("PlotEventID,PlotLineID,CreatedDate",""),
["PlotLines"]=("PlotLineID,ProjectID,BookID,PlotLineName,PlotLineTypeID,Description,ParentPlotLineID,SortOrder,Colour,IsVisibleOnTimeline,CreatedDate,UpdatedDate,IsArchived,ArchivedDate,ArchivedReason,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC,PlotImportanceID,EmergesFromPlotLineID","BookID,Description,ParentPlotLineID,ArchivedDate,ArchivedReason,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC,EmergesFromPlotLineID"),
["PlotThreads"]=("PlotThreadID,PlotLineID,ThreadTitle,ThreadTypeID,ThreadStatusID,Importance,Summary,IntroducedSceneID,PlannedResolutionSceneID,ActualResolutionSceneID,CreatedDate,UpdatedDate,IsArchived,ArchivedDate,ArchivedReason,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC","Summary,IntroducedSceneID,PlannedResolutionSceneID,ActualResolutionSceneID,ArchivedDate,ArchivedReason,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC"),
["Project"]=("ProjectID,ProjectName,Description,CreatedDate,IsArchived,ArchivedDate,ArchivedReason,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC","Description,ArchivedDate,ArchivedReason,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC"),
["RelationshipEvents"]=("RelationshipEventID,CharacterRelationshipID,SceneID,RelationshipStateID,Intensity,IsKnownToOtherCharacter,Description,CreatedDate,UpdatedDate,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC,SourceReviewKey","Intensity,Description,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC,SourceReviewKey"),
["ScenarioSceneOrder"]=("ScenarioSceneOrderID,ScenarioID,SceneID,ProposedChapterID,ProposedSortOrder,Notes,CreatedDate,UpdatedDate","ProposedChapterID,Notes"),
["ScenarioValidationRuns"]=("ScenarioValidationRunID,ScenarioID,StartedDate,CompletedDate,WarningCount","CompletedDate"),
["ScenarioWarnings"]=("ScenarioWarningID,ScenarioValidationRunID,ScenarioID,SceneID,EntityType,EntityID,WarningTypeName,SeverityName,Message,Details,CreatedDate","SceneID,EntityID,Details"),
["Scenarios"]=("ScenarioID,ProjectID,BookID,ScenarioName,Description,BaseCreatedDate,IsAppliedToMain,IsArchived,CreatedDate,UpdatedDate,ArchivedDate,ArchivedReason","BookID,Description,ArchivedDate,ArchivedReason"),
["SceneAssetLocations"]=("SceneAssetLocationID,SceneID,StoryAssetID,LocationID,Description,CreatedDate,UpdatedDate","Description"),
["SceneAssetSuggestions"]=("SceneAssetSuggestionID,SceneID,AssetID,SuggestionSource,DetectedUtc,Status,Confidence,Reason,CreatedByUserID,ReviewedByUserID,ReviewedUtc","Reason,ReviewedByUserID,ReviewedUtc"),
["SceneAttachments"]=("SceneAttachmentID,SceneID,SceneAttachmentTypeID,Title,FilePath,ExternalUrl,Notes,CreatedDate,UpdatedDate,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC","FilePath,ExternalUrl,Notes,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC"),
["SceneCharacterSuggestions"]=("SceneCharacterSuggestionID,SceneID,CharacterID,SuggestionSource,DetectedUtc,Status,Confidence,Reason,CreatedByUserID,ReviewedByUserID,ReviewedUtc","Reason,ReviewedByUserID,ReviewedUtc"),
["SceneCharacters"]=("SceneCharacterID,SceneID,CharacterID,RoleInSceneTypeID,PresenceTypeID,LocationID,EntryLocationID,ExitLocationID,AppearanceNotes,OutfitDescription,PhysicalCondition,EmotionalState,KnowledgeNotes,CreatedDate,UpdatedDate,MatchSource,MatchedText,OccurrenceCount,FirstOccurrenceIndex","RoleInSceneTypeID,PresenceTypeID,LocationID,EntryLocationID,ExitLocationID,AppearanceNotes,OutfitDescription,PhysicalCondition,EmotionalState,KnowledgeNotes,MatchSource,MatchedText,OccurrenceCount,FirstOccurrenceIndex"),
["SceneChecklistItems"]=("SceneChecklistItemID,SceneID,ItemText,IsCompleted,SortOrder,CreatedDate,UpdatedDate,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC","SortOrder,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC"),
["SceneDependencies"]=("SceneDependencyID,SourceSceneID,TargetSceneID,SceneDependencyTypeID,Description,CreatedDate,UpdatedDate,IsArchived,ProjectID,IsHardDependency","Description,ProjectID"),
["SceneFloorPlanOccupancy"]=("SceneFloorPlanOccupancyID,SceneID,FloorPlanID,FloorPlanFloorID,CharacterID,StoryAssetID,LocationID,CreatedDate,ModifiedDate","FloorPlanFloorID,CharacterID,StoryAssetID,ModifiedDate"),
["SceneLocationSuggestions"]=("SceneLocationSuggestionID,SceneID,LocationID,SuggestionSource,DetectedUtc,Status,Confidence,Reason,CreatedByUserID,ReviewedByUserID,ReviewedUtc","Reason,ReviewedByUserID,ReviewedUtc"),
["SceneManuscriptSources"]=("SceneID,ProjectID,BookID,ChapterID,SourceText,SourceWordCount,SourceCharacterCount,SourceStartParagraph,SourceEndParagraph,WordStartParagraphIndex,WordEndParagraphIndex,SourceKind,CreatedUtc,UpdatedUtc","SourceStartParagraph,SourceEndParagraph,WordStartParagraphIndex,WordEndParagraphIndex"),
["SceneMetricTypes"]=("MetricTypeID,ProjectID,MetricName,Description,MinValue,MaxValue,DefaultValue,SortOrder,IsActive","ProjectID,Description"),
["SceneMetricValues"]=("SceneID,MetricTypeID,Value,Notes","Notes"),
["SceneNotes"]=("SceneNoteID,SceneID,SceneNoteTypeID,NoteTitle,NoteText,SortOrder,IsPinned,IsResolved,CreatedDate,UpdatedDate,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC","NoteTitle,SortOrder,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC"),
["SceneOutcomes"]=("SceneOutcomeID,SceneID,OutcomeDescription,OutcomeTypeID,CreatedDate,UpdatedDate","OutcomeTypeID"),
["ScenePurposes"]=("SceneID,ScenePurposeTypeID",""),
["SceneTextStatistics"]=("SceneID,TotalWordCount,DialogueWordCount,ProseWordCount,TotalParagraphCount,DialogueParagraphCount,ProseParagraphCount,CalculatedUtc,UpdatedUtc",""),
["SceneWorkflow"]=("SceneWorkflowID,SceneID,DraftStatus,EstimatedWordCount,ActualWordCount,DraftedDate,LastWorkedOn,ReadyForDraft,ReadyForRevision,ReadyForPolish,IsBlocked,BlockedReason,Priority,CreatedDate,UpdatedDate,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC","EstimatedWordCount,ActualWordCount,DraftedDate,LastWorkedOn,BlockedReason,Priority,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC"),
["Scenes"]=("SceneID,ChapterID,SceneNumber,SceneTitle,Summary,POVCharacterID,PrimaryLocationID,SortOrder,TimeModeID,StartDateTime,EndDateTime,DurationAmount,DurationUnitID,RelativeTimeText,TimeConfidenceID,ScenePurposeNotes,SceneOutcomeNotes,RevisionStatusID,CreatedDate,UpdatedDate,IsArchived,ArchivedDate,ArchivedReason,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC,FloorPlanID,InitialFloorPlanFloorID,IsLinkedToManuscript,ManuscriptDocumentID,ExternalReference,LinkedUtc,ImportSource,ImportRunID,SourceStartParagraph,SourceEndParagraph,StructuralSummary,SceneTitleSource,POVSource,POVConfidence,POVEvidence,POVSuggestedName,StructuralSetting","Summary,POVCharacterID,PrimaryLocationID,StartDateTime,EndDateTime,DurationAmount,DurationUnitID,RelativeTimeText,ScenePurposeNotes,SceneOutcomeNotes,ArchivedDate,ArchivedReason,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC,FloorPlanID,InitialFloorPlanFloorID,ManuscriptDocumentID,ExternalReference,LinkedUtc,ImportSource,ImportRunID,SourceStartParagraph,SourceEndParagraph,StructuralSummary,SceneTitleSource,POVSource,POVConfidence,POVEvidence,POVSuggestedName,StructuralSetting"),
["StoryAssets"]=("StoryAssetID,ProjectID,AssetName,AssetKindID,Description,Importance,CurrentStateID,CurrentLocationID,IsResolved,CreatedDate,UpdatedDate,IsArchived,ArchivedDate,ArchivedReason,ShowInQuickAddBar,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC,ImagePath,ThumbnailPath","Description,CurrentStateID,CurrentLocationID,ArchivedDate,ArchivedReason,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC,ImagePath,ThumbnailPath"),
["StoryIntelligenceBookPipelines"]=("StoryIntelligenceBookPipelineID,ProjectID,BookID,CurrentStage,LastCompletedStage,CurrentReviewStage,Status,CompletedUtc,LastRunID,CreatedUtc,UpdatedUtc,CompletionEmailQueuedUtc,FailureEmailQueuedUtc,CharacterReviewCompletedUtc,LocationReviewCompletedUtc,AssetReviewCompletedUtc,RelationshipReviewCompletedUtc,KnowledgeReviewCompletedUtc,NarrativeReviewCompletedUtc","LastCompletedStage,CurrentReviewStage,CompletedUtc,LastRunID,CompletionEmailQueuedUtc,FailureEmailQueuedUtc,CharacterReviewCompletedUtc,LocationReviewCompletedUtc,AssetReviewCompletedUtc,RelationshipReviewCompletedUtc,KnowledgeReviewCompletedUtc,NarrativeReviewCompletedUtc"),
["StoryIntelligenceChapterResults"]=("ChapterResultID,StoryIntelligenceRunID,ProjectID,BookID,ChapterID,ChapterNumber,SourceLabel,PromptVersion,Model,RawResponseJson,OutputTextJson,ParsedJson,ValidationErrorsCount,ValidationWarningsCount,InputTokens,OutputTokens,TotalTokens,DurationMs,CreatedUtc","ProjectID,BookID,ChapterID,ChapterNumber,InputTokens,OutputTokens,TotalTokens,DurationMs"),
["StoryIntelligenceIllustrationDemands"]=("StoryIntelligenceIllustrationDemandID,ProjectID,DemandKey,AgeBand,Presentation,HairColour,SkinTone,HairLength,Glasses,FacialHair,RequestCount,LastRequestedUtc,CreatedUtc,UpdatedUtc,QueuedUtc,GenerationSource","ProjectID,HairLength,Glasses,FacialHair,QueuedUtc"),
["StoryIntelligenceImportCommits"]=("StoryIntelligenceImportCommitID,StoryIntelligenceRunID,ProjectID,BookID,ChapterID,CommittedAt,CommittedByUserID,ScenesCreated,MetricsCreated,Status,Notes,CreatedUtc","ProjectID,BookID,ChapterID,Notes"),
["StoryIntelligenceNarrativeCandidateEvents"]=("NarrativeCandidateEventID,NarrativeCandidateID,WholeBookPlotSynthesisRunID,EventKey,SceneID,EventType,EventTitle,EventDescription,Evidence,Confidence,SortOrder,IsIgnored,AcceptedThreadEventID,CreatedUtc,UpdatedUtc","WholeBookPlotSynthesisRunID,EventDescription,Evidence,Confidence,AcceptedThreadEventID"),
["StoryIntelligenceNarrativeCandidateEvidence"]=("NarrativeCandidateEvidenceID,NarrativeCandidateID,SceneID,ContributionType,Evidence,SortOrder,CreatedUtc","ContributionType,Evidence"),
["StoryIntelligenceNarrativeCandidates"]=("NarrativeCandidateID,ProjectID,BookID,CandidateType,CandidateKey,ProposedTitle,ProposedDescription,Category,InferredState,ExistingPlotLineID,ExistingPlotThreadID,RelatedPlotLineID,Confidence,Status,ReviewAction,AcceptedPlotLineID,AcceptedPlotThreadID,ReviewedByUserID,ReviewedUtc,CreatedUtc,UpdatedUtc,ChangeType,Significance,ParentCandidateKey,ParentNarrativeCandidateID,MergeTargetNarrativeCandidateID,WholeBookPlotSynthesisRunID,AuthorPlotSeedID,ExistingPlotLineMatchConfidence,ExistingPlotLineMatchReason,SeedMatchConfidence,SeedMatchReason,Source","ProposedDescription,Category,InferredState,ExistingPlotLineID,ExistingPlotThreadID,RelatedPlotLineID,Confidence,ReviewAction,AcceptedPlotLineID,AcceptedPlotThreadID,ReviewedByUserID,ReviewedUtc,ChangeType,Significance,ParentCandidateKey,ParentNarrativeCandidateID,MergeTargetNarrativeCandidateID,WholeBookPlotSynthesisRunID,AuthorPlotSeedID,ExistingPlotLineMatchConfidence,ExistingPlotLineMatchReason,SeedMatchConfidence,SeedMatchReason,Source"),
["StoryIntelligenceReviewCandidateEvidence"]=("ReviewCandidateEvidenceID,ReviewCandidateID,SceneID,EvidenceText,Confidence,SortOrder,CreatedUtc","SceneID,Confidence"),
["StoryIntelligenceReviewCandidateGenerations"]=("ReviewCandidateGenerationID,ProjectID,BookID,Module,Status,Source,CandidateCount,PendingCount,ErrorMessage,IsCurrent,CreatedUtc,PreparedUtc,FailedUtc,UpdatedUtc","ErrorMessage,PreparedUtc,FailedUtc"),
["StoryIntelligenceReviewCandidates"]=("ReviewCandidateID,ReviewCandidateGenerationID,ProjectID,BookID,Module,StableKey,CandidateType,DisplayName,SortOrder,Confidence,ExistingCanonicalID,DecisionStatus,DecisionAction,DecisionTargetKey,DecisionCanonicalID,CandidatePayloadJson,CreatedUtc,ReviewedUtc,UpdatedUtc,ReviewPriority,AssessmentJson","CandidateType,Confidence,ExistingCanonicalID,DecisionAction,DecisionTargetKey,DecisionCanonicalID,ReviewedUtc,AssessmentJson"),
["StoryIntelligenceRuns"]=("StoryIntelligenceRunID,UserID,ProjectID,BookID,Status,SourceType,PromptVersion,Model,StartedUtc,CompletedUtc,TotalInputTokens,TotalOutputTokens,TotalTokens,TotalDurationMs,ErrorMessage,CreatedUtc,UpdatedUtc,SourceFileName,SourceFileSizeBytes,SourceWordCount,SourceCharacterCount,SourceChapterCount,SourceDetectedImagesCount,SourceDetectedTablesCount,SourceDetectedFootnotesCount,SourceDetectedCommentsCount,FailureStage,ErrorDetail,EstimatedCostGBP,EstimatedCostUSD,PromptVersionsSummary,SourceLabel,SourceText,CurrentStage,CurrentMessage,TotalDetectedScenes,CompletedScenes,FailedScenes,CancellationRequestedUtc,CancelledUtc,ChapterID,ChapterNumber,SourceParagraphCount,KnownCharactersJson","ProjectID,BookID,CompletedUtc,TotalInputTokens,TotalOutputTokens,TotalTokens,TotalDurationMs,ErrorMessage,SourceFileName,SourceFileSizeBytes,SourceWordCount,SourceCharacterCount,SourceChapterCount,SourceDetectedImagesCount,SourceDetectedTablesCount,SourceDetectedFootnotesCount,SourceDetectedCommentsCount,FailureStage,ErrorDetail,EstimatedCostGBP,EstimatedCostUSD,PromptVersionsSummary,SourceLabel,SourceText,CurrentStage,CurrentMessage,TotalDetectedScenes,CompletedScenes,FailedScenes,CancellationRequestedUtc,CancelledUtc,ChapterID,ChapterNumber,SourceParagraphCount,KnownCharactersJson"),
["StoryIntelligenceSceneResults"]=("SceneResultID,StoryIntelligenceRunID,ChapterResultID,ProjectID,BookID,ChapterID,SceneID,TemporarySceneNumber,StartParagraph,EndParagraph,SourceLabel,PromptVersion,Model,RawResponseJson,OutputTextJson,ParsedJson,ValidationErrorsCount,ValidationWarningsCount,InputTokens,OutputTokens,TotalTokens,DurationMs,CreatedUtc","ChapterResultID,ProjectID,BookID,ChapterID,SceneID,StartParagraph,EndParagraph,InputTokens,OutputTokens,TotalTokens,DurationMs"),
["StoryMaps"]=("MapID,ProjectID,ParentMapID,ParentFeatureID,Name,Kind,Revision,ModifiedDate,AppearanceJson,ReferenceJson","ParentMapID,ParentFeatureID"),
["StoryMemoryAssets"]=("StoryMemoryAssetID,ImportSessionID,ProjectID,BookID,CanonicalIdentityKey,DisplayName,SemanticType,Subtype,Colour,Era,FirstSeenSceneResultID,LastSeenSceneResultID,CreatedUtc,UpdatedUtc","Subtype,Colour,Era,FirstSeenSceneResultID,LastSeenSceneResultID"),
["StoryMemoryCharacterAliases"]=("StoryMemoryCharacterAliasID,StoryMemoryCharacterID,Alias,NormalisedAlias,ResolutionReason,SourceSceneResultID,Confidence,CreatedUtc","ResolutionReason,SourceSceneResultID"),
["StoryMemoryCharacterAttributes"]=("StoryMemoryCharacterAttributeID,StoryMemoryCharacterID,AttributeType,NormalisedValue,Confidence,IsExplicit,EvidenceSummary,SourceSceneResultID,SupersededUtc,CreatedUtc","EvidenceSummary,SourceSceneResultID,SupersededUtc"),
["StoryMemoryCharacters"]=("StoryMemoryCharacterID,ImportSessionID,ProjectID,BookID,CanonicalIdentityKey,DisplayName,EntityContext,SourceSectionType,IsNamed,IsGroupEntity,IsResolved,IsNarrator,IsPrimaryPOV,Significance,EvidenceVersion,CreatedSceneResultID,LastUpdatedSceneResultID,CreatedUtc,UpdatedUtc","CreatedSceneResultID,LastUpdatedSceneResultID"),
["StoryMemoryIllustrationAssignments"]=("StoryMemoryIllustrationAssignmentID,ImportSessionID,EntityType,EntityID,IllustrationLibraryItemID,StableCode,AssignmentStatus,IsFallback,MatchScore,Confidence,AssignmentReason,EvidenceVersion,AssignedUtc,LastValidatedUtc,InvalidatedUtc,InvalidationReason,CreatedUtc,UpdatedUtc","IllustrationLibraryItemID,StableCode,AssignmentReason,InvalidatedUtc,InvalidationReason"),
["StoryMemoryIllustrationDemands"]=("StoryMemoryIllustrationDemandID,ImportSessionID,ProjectID,EntityType,ArchetypeKey,DemandCount,WaitingEntityCount,Status,QueuedIllustrationLibraryItemID,GeneratedIllustrationLibraryItemID,CreatedUtc,UpdatedUtc","QueuedIllustrationLibraryItemID,GeneratedIllustrationLibraryItemID"),
["StoryMemoryImportPreferences"]=("StoryMemoryImportPreferenceID,ImportSessionID,AppearancePreference,ResolverVersion,CreatedUtc,UpdatedUtc,PrimaryAgeGroup,StoryEra,StoryLocation","PrimaryAgeGroup,StoryEra,StoryLocation"),
["StoryMemoryLocations"]=("StoryMemoryLocationID,ImportSessionID,ProjectID,BookID,CanonicalIdentityKey,DisplayName,SemanticType,Subtype,InteriorExterior,ParentLocationID,FirstSeenSceneResultID,LastSeenSceneResultID,CreatedUtc,UpdatedUtc","Subtype,InteriorExterior,ParentLocationID,FirstSeenSceneResultID,LastSeenSceneResultID"),
["StoryMemoryProcessedSceneResults"]=("StoryMemoryProcessedSceneResultID,ImportSessionID,SceneResultID,ProcessorVersion,SnapshotHash,ProcessedUtc","SnapshotHash"),
["StoryMemoryRelationships"]=("StoryMemoryRelationshipID,ImportSessionID,SourceEntityType,SourceEntityID,TargetEntityType,TargetEntityID,RelationshipType,Confidence,IsExplicit,FirstSeenSceneResultID,LastUpdatedSceneResultID,Active,CreatedUtc,UpdatedUtc","FirstSeenSceneResultID,LastUpdatedSceneResultID"),
["ThreadEvents"]=("ThreadEventID,PlotThreadID,SceneID,EventTypeID,EventTitle,EventDescription,CreatedDate,UpdatedDate,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC,PlotEventTypeID,TargetPlotLineID,Source,SourceReferenceID,SourceKey,Confidence","EventDescription,CreatedByUserID,ModifiedByUserID,CreatedDateUTC,ModifiedDateUTC,TargetPlotLineID,SourceReferenceID,SourceKey,Confidence"),
["TimelineMetricSettings"]=("ProjectID,MetricTypeID,SortOrder,CreatedDate",""),
["TimelineSettings"]=("ProjectTimelineSettingsID,ProjectID,ShowSceneCards,ShowMetricShape,ShowPlotLines,ShowStoryAssets,ShowCharacterAppearances,ShowWarnings,CreatedDate,UpdatedDate",""),
["TimelineViewPresets"]=("TimelineViewPresetID,ProjectID,BookID,PresetName,FilterJson,VisibilityJson,FocusType,FocusID,CreatedDate,UpdatedDate,IsArchived","BookID,FocusType,FocusID"),
["ValidationRuns"]=("ValidationRunID,ProjectID,BookID,StartedDate,CompletedDate,TriggeredBy,ScopeDescription","BookID,CompletedDate,TriggeredBy,ScopeDescription"),
["WholeBookPlotSynthesisRuns"]=("WholeBookPlotSynthesisRunID,ProjectID,BookID,UserID,SourceStoryIntelligenceRunID,CharacterResolutionVersion,Status,QueuedUtc,StartedUtc,CompletedUtc,FailedUtc,AttemptCount,Model,OpenAIResponseID,InputTokens,OutputTokens,CachedInputTokens,TotalTokens,DurationMs,ErrorMessage,ErrorDetail,ResultJson,IsCurrent,UpdatedUtc","SourceStoryIntelligenceRunID,StartedUtc,CompletedUtc,FailedUtc,Model,OpenAIResponseID,InputTokens,OutputTokens,CachedInputTokens,TotalTokens,DurationMs,ErrorMessage,ErrorDetail,ResultJson"),
["WordCompanionSceneAssets"]=("WordCompanionSceneAssetID,SceneID,StoryAssetID,CreatedDate,UpdatedDate",""),
["WordCompanionSceneLocations"]=("WordCompanionSceneLocationID,SceneID,LocationID,CreatedDate,UpdatedDate",""),
["WritingPlans"]=("WritingPlanID,UserID,ProjectID,BookID,PlanName,GoalType,StartDate,DeadlineDate,AvailableDaysJson,SessionLengthMinutes,IncludeBlockedScenes,RebalanceMode,IsActive,CreatedDateUtc,ModifiedDateUtc","BookID"),
["WritingScheduleItems"]=("WritingScheduleItemID,WritingPlanID,SceneID,ScheduledDate,TaskType,EstimatedMinutes,TargetWords,ScheduleStatus,CompletedDateUtc,Notes,CreatedDateUtc,ModifiedDateUtc","EstimatedMinutes,TargetWords,CompletedDateUtc,Notes"),
};
}