Phase 5: Add EF migration for soft delete columns; use shadow property for xmin
- Migration adds IsDeleted/DeletedAt to Budgets, Incomes, Outgos, BudgetShares - xmin concurrency token configured as shadow property (uint, xid type) — not added as a column in the migration since xmin is a PostgreSQL system column - Budget.RowVersion property removed; concurrency tracked via shadow property only
This commit is contained in:
@@ -23,8 +23,7 @@ public class AppDbContext(DbContextOptions<AppDbContext> options) : DbContext(op
|
||||
b.HasMany(x => x.Outgos).WithOne(o => o.Budget).HasForeignKey(o => o.BudgetId).OnDelete(DeleteBehavior.Cascade);
|
||||
b.HasMany(x => x.Shares).WithOne(s => s.Budget).HasForeignKey(s => s.BudgetId).OnDelete(DeleteBehavior.Cascade);
|
||||
b.HasQueryFilter(x => !x.IsDeleted);
|
||||
b.Property(e => e.RowVersion)
|
||||
.HasColumnName("xmin")
|
||||
b.Property<uint>("xmin")
|
||||
.HasColumnType("xid")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.IsConcurrencyToken();
|
||||
|
||||
Reference in New Issue
Block a user