Files
jobtrackingapp/JobTrackerApi/Services/StartupSchemaOwnership.cs
T
cesnimda 2e2d649f6f refactor(db): migrate auth support tables
Move recovery codes, trusted devices, and revocable sessions into an additive provider-aware migration. Preserve existing security records and retain guarded MariaDB repairs for historical schemas.
2026-08-30 16:52:07 +02:00

72 lines
2.3 KiB
C#

namespace JobTrackerApi.Services;
/// <summary>
/// Records the current table-creation owner while the legacy startup reconciler is retired in
/// migration-backed increments. This is a governance boundary, not a second schema definition.
/// A table must appear in exactly one creation set.
/// </summary>
internal static class StartupSchemaOwnership
{
internal static readonly IReadOnlySet<string> MigrationOwnedTables = new HashSet<string>(StringComparer.Ordinal)
{
"AccountDeletionFiles",
"AccountDeletionRequests",
"AiUsageRecords",
"Attachments",
"Companies",
"Correspondences",
"EmailDrafts",
"EmailSendAttempts",
"GmailReviewDecisions",
"JobApplications",
"JobEvents",
"Jobs",
"RuleSettings",
"SystemEmailSettings",
"TrustedDevices",
"TwoFactorRecoveryCodes",
"UserNotifications",
"UserOperations",
"UserRuleSettings",
"UserSessions",
};
internal static readonly IReadOnlySet<string> ReconcilerOwnedTables = new HashSet<string>(StringComparer.Ordinal)
{
"AiInteractions",
"AiWorkspaceNotes",
"ApplicationChecklistItems",
"AspNetRoleClaims",
"AspNetRoles",
"AspNetUserClaims",
"AspNetUserLogins",
"AspNetUserRoles",
"AspNetUsers",
"AspNetUserTokens",
"CareerCertifications",
"CareerEducations",
"CareerExperiences",
"CareerLanguages",
"CareerProfiles",
"CareerProfileVersions",
"CareerProjects",
"CareerSkills",
"CoverLetterVersions",
"CvExtractionRuns",
"CvUploadArtifacts",
"CvVariants",
"CvVariantVersions",
"GmailConnections",
"ImapConnections",
"InterviewPrepItems",
"InterviewPrepNotes",
"MicrosoftGraphConnections",
"TailoredCvDrafts",
};
// Historical migrations contain guarded compatibility bootstraps for these tables so direct
// EF tooling can traverse the chain. Their current creation owner remains the reconciler.
internal static readonly IReadOnlySet<string> MigrationCompatibilityBootstrapTables =
new HashSet<string>(StringComparer.Ordinal) { "AiInteractions", "AspNetUsers" };
}