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:
Spencer Twaddle
2026-05-02 17:17:48 -05:00
parent 2908397b1e
commit bc9f55ef91
5 changed files with 404 additions and 4 deletions
@@ -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();