Change where the MigrationTable are to be created. Improve the update-databases.sh script

This commit is contained in:
Jonathan Bourdon
2024-07-24 16:37:34 -04:00
parent 0faf5a9a0e
commit 042fd53463
4 changed files with 32 additions and 15 deletions

View File

@@ -6,10 +6,12 @@ public class ContentDbContext(
DbContextOptions<ContentDbContext> options)
: DbContext(options)
{
public const string SchemaName = "Content";
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.HasDefaultSchema("Content");
modelBuilder
.Entity<Content>()
.Property(c => c.CreatedAt)

View File

@@ -7,9 +7,11 @@ public class MessagingDbContext(
DbContextOptions<MessagingDbContext> options)
: DbContext(options)
{
public const string SchemaName = "Messaging";
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.HasDefaultSchema("Messaging");
modelBuilder.HasDefaultSchema(SchemaName);
modelBuilder
.Entity<Message>()