fix: Configure EF Core migration history tables with schema-qualified names
Each DbContext now explicitly configures its migration history table to use the schema-qualified name pattern [schemaName].[_Migrations]: - [cvMatcher].[_Migrations] for CvMatcherDbContext - [emailApi].[_Migrations] for EmailApiDbContext - [cvSearch].[_Migrations] for CvSearchDbContext - [rag].[_Migrations] for RagDbContext - [myAi].[_Migrations] for MyAiDbContext This is done via OnConfiguring() with UseSqlServer().MigrationsHistoryTable(name, schema). Removed incorrect rename migrations that were created due to misunderstanding of the proper EF Core configuration approach. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,13 @@ public sealed class CvSearchDbContext : DbContext
|
||||
public DbSet<JobSearchSessionEntity> JobSearchSessions => Set<JobSearchSessionEntity>();
|
||||
public DbSet<JobSearchResultEntity> JobSearchResults => Set<JobSearchResultEntity>();
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
base.OnConfiguring(optionsBuilder);
|
||||
// Configure migration history table to use schema-qualified name: [cvSearch].[_Migrations]
|
||||
optionsBuilder.UseSqlServer(x => x.MigrationsHistoryTable(MigrationTableName, SchemaName));
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.HasDefaultSchema(SchemaName);
|
||||
|
||||
Reference in New Issue
Block a user