From 0e1b0345ecbbbf4f4a08137f9a73840e09f868cc Mon Sep 17 00:00:00 2001 From: alireza Date: Tue, 9 Jun 2026 02:40:13 +0330 Subject: [PATCH] feat: disable identity auto-generation for reference/lookup tables Reference tables (Province, City, BasicTable, IncomeCostTitle, UnitState, Transaction) require stable, manually assigned IDs that are cross-referenced by other entities. Identity auto-generation is disabled to allow explicit ID assignment from seed data. --- Complex.Infrastructure/ComplexDBContext.cs | 37 +++++++++++++++++ ... 20260608225845_InitialCreate.Designer.cs} | 40 +++++-------------- ...ate.cs => 20260608225845_InitialCreate.cs} | 38 ++++++++---------- .../ComplexDBContextModelSnapshot.cs | 38 +++++------------- 4 files changed, 74 insertions(+), 79 deletions(-) rename Complex.Infrastructure/Migrations/{20260608225159_InitialCreate.Designer.cs => 20260608225845_InitialCreate.Designer.cs} (95%) rename Complex.Infrastructure/Migrations/{20260608225159_InitialCreate.cs => 20260608225845_InitialCreate.cs} (96%) diff --git a/Complex.Infrastructure/ComplexDBContext.cs b/Complex.Infrastructure/ComplexDBContext.cs index 3ff5288..736ad56 100644 --- a/Complex.Infrastructure/ComplexDBContext.cs +++ b/Complex.Infrastructure/ComplexDBContext.cs @@ -77,6 +77,43 @@ namespace Complex.Infrastructure .WithMany() .HasForeignKey(uc => uc.UnitId) .OnDelete(DeleteBehavior.NoAction); + + // ============================================================ + // Reference/Lookup tables: These have fixed, meaningful IDs + // that are explicitly set in seed data and cross-referenced + // by other entities. Identity auto-generation must be disabled. + // ============================================================ + + // Province: ProvinceId (1-31) are stable identifiers + builder.Entity() + .Property(p => p.ProvinceId) + .ValueGeneratedNever(); + + // City: CityId (101, 102, ...) are meaningful (provinceId * 100 + index) + builder.Entity() + .Property(c => c.CityId) + .ValueGeneratedNever(); + + // BasicTable (base for TransactionType): Id (1,2) are fixed reference data + builder.Entity() + .Property(b => b.Id) + .ValueGeneratedNever(); + + // IncomeCostTitle: Id (1-12) are fixed reference data + builder.Entity() + .Property(i => i.Id) + .ValueGeneratedNever(); + + // UnitState: Id (1-5) are fixed reference data + builder.Entity() + .Property(u => u.Id) + .ValueGeneratedNever(); + + // Transaction: Seeder uses explicit IDs (1,2,3) that are + // cross-referenced by UnitCost.TransactionId + builder.Entity() + .Property(t => t.Id) + .ValueGeneratedNever(); } diff --git a/Complex.Infrastructure/Migrations/20260608225159_InitialCreate.Designer.cs b/Complex.Infrastructure/Migrations/20260608225845_InitialCreate.Designer.cs similarity index 95% rename from Complex.Infrastructure/Migrations/20260608225159_InitialCreate.Designer.cs rename to Complex.Infrastructure/Migrations/20260608225845_InitialCreate.Designer.cs index 44cb197..ab1d28a 100644 --- a/Complex.Infrastructure/Migrations/20260608225159_InitialCreate.Designer.cs +++ b/Complex.Infrastructure/Migrations/20260608225845_InitialCreate.Designer.cs @@ -12,7 +12,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Complex.Infrastructure.Migrations { [DbContext(typeof(ComplexDBContext))] - [Migration("20260608225159_InitialCreate")] + [Migration("20260608225845_InitialCreate")] partial class InitialCreate { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -27,11 +27,8 @@ namespace Complex.Infrastructure.Migrations modelBuilder.Entity("Complex.Domain.Entities.BasicTable", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - b.Property("Discriminator") .IsRequired() .HasColumnType("nvarchar(max)"); @@ -77,11 +74,8 @@ namespace Complex.Infrastructure.Migrations modelBuilder.Entity("Complex.Domain.Entities.City", b => { b.Property("CityId") - .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("CityId"), 1L, 1); - b.Property("CityTitle") .HasColumnType("nvarchar(max)"); @@ -119,7 +113,7 @@ namespace Complex.Infrastructure.Migrations b.Property("InsertTime") .ValueGeneratedOnAdd() .HasColumnType("datetime2") - .HasDefaultValue(new DateTime(2026, 6, 9, 2, 21, 59, 646, DateTimeKind.Local).AddTicks(1882)); + .HasDefaultValue(new DateTime(2026, 6, 9, 2, 28, 45, 623, DateTimeKind.Local).AddTicks(7632)); b.Property("IsRemoved") .ValueGeneratedOnAdd() @@ -178,7 +172,7 @@ namespace Complex.Infrastructure.Migrations b.Property("InsertTime") .ValueGeneratedOnAdd() .HasColumnType("datetime2") - .HasDefaultValue(new DateTime(2026, 6, 9, 2, 21, 59, 646, DateTimeKind.Local).AddTicks(3884)); + .HasDefaultValue(new DateTime(2026, 6, 9, 2, 28, 45, 624, DateTimeKind.Local).AddTicks(2426)); b.Property("IsRemoved") .ValueGeneratedOnAdd() @@ -254,7 +248,7 @@ namespace Complex.Infrastructure.Migrations b.Property("InsertTime") .ValueGeneratedOnAdd() .HasColumnType("datetime2") - .HasDefaultValue(new DateTime(2026, 6, 9, 2, 21, 59, 646, DateTimeKind.Local).AddTicks(4981)); + .HasDefaultValue(new DateTime(2026, 6, 9, 2, 28, 45, 624, DateTimeKind.Local).AddTicks(5016)); b.Property("IsRemoved") .ValueGeneratedOnAdd() @@ -306,7 +300,7 @@ namespace Complex.Infrastructure.Migrations b.Property("InsertTime") .ValueGeneratedOnAdd() .HasColumnType("datetime2") - .HasDefaultValue(new DateTime(2026, 6, 9, 2, 21, 59, 646, DateTimeKind.Local).AddTicks(6348)); + .HasDefaultValue(new DateTime(2026, 6, 9, 2, 28, 45, 624, DateTimeKind.Local).AddTicks(7249)); b.Property("IsRemoved") .ValueGeneratedOnAdd() @@ -338,18 +332,15 @@ namespace Complex.Infrastructure.Migrations modelBuilder.Entity("Complex.Domain.Entities.IncomeCostTitle", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - b.Property("ComplexId") .HasColumnType("uniqueidentifier"); b.Property("InsertTime") .ValueGeneratedOnAdd() .HasColumnType("datetime2") - .HasDefaultValue(new DateTime(2026, 6, 9, 2, 21, 59, 646, DateTimeKind.Local).AddTicks(8225)); + .HasDefaultValue(new DateTime(2026, 6, 9, 2, 28, 45, 624, DateTimeKind.Local).AddTicks(9858)); b.Property("IsRemoved") .ValueGeneratedOnAdd() @@ -397,7 +388,7 @@ namespace Complex.Infrastructure.Migrations b.Property("InsertTime") .ValueGeneratedOnAdd() .HasColumnType("datetime2") - .HasDefaultValue(new DateTime(2026, 6, 9, 2, 21, 59, 647, DateTimeKind.Local).AddTicks(86)); + .HasDefaultValue(new DateTime(2026, 6, 9, 2, 28, 45, 625, DateTimeKind.Local).AddTicks(1728)); b.Property("IsActive") .HasColumnType("bit"); @@ -448,11 +439,8 @@ namespace Complex.Infrastructure.Migrations modelBuilder.Entity("Complex.Domain.Entities.Province", b => { b.Property("ProvinceId") - .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ProvinceId"), 1L, 1); - b.Property("ProvinceTitle") .HasColumnType("nvarchar(max)"); @@ -494,11 +482,8 @@ namespace Complex.Infrastructure.Migrations modelBuilder.Entity("Complex.Domain.Entities.Transaction", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnType("bigint"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - b.Property("Amount") .HasColumnType("bigint"); @@ -517,7 +502,7 @@ namespace Complex.Infrastructure.Migrations b.Property("InsertTime") .ValueGeneratedOnAdd() .HasColumnType("datetime2") - .HasDefaultValue(new DateTime(2026, 6, 9, 2, 21, 59, 648, DateTimeKind.Local).AddTicks(3522)); + .HasDefaultValue(new DateTime(2026, 6, 9, 2, 28, 45, 625, DateTimeKind.Local).AddTicks(3921)); b.Property("IsRemoved") .ValueGeneratedOnAdd() @@ -588,7 +573,7 @@ namespace Complex.Infrastructure.Migrations b.Property("InsertTime") .ValueGeneratedOnAdd() .HasColumnType("datetime2") - .HasDefaultValue(new DateTime(2026, 6, 9, 2, 21, 59, 649, DateTimeKind.Local).AddTicks(412)); + .HasDefaultValue(new DateTime(2026, 6, 9, 2, 28, 45, 625, DateTimeKind.Local).AddTicks(7151)); b.Property("IsActive") .HasColumnType("bit"); @@ -659,7 +644,7 @@ namespace Complex.Infrastructure.Migrations b.Property("InsertTime") .ValueGeneratedOnAdd() .HasColumnType("datetime2") - .HasDefaultValue(new DateTime(2026, 6, 9, 2, 21, 59, 649, DateTimeKind.Local).AddTicks(6073)); + .HasDefaultValue(new DateTime(2026, 6, 9, 2, 28, 45, 625, DateTimeKind.Local).AddTicks(9764)); b.Property("IsRemoved") .ValueGeneratedOnAdd() @@ -690,11 +675,8 @@ namespace Complex.Infrastructure.Migrations modelBuilder.Entity("Complex.Domain.Entities.UnitState", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - b.Property("ComplexId") .HasColumnType("uniqueidentifier"); @@ -705,7 +687,7 @@ namespace Complex.Infrastructure.Migrations b.Property("InsertTime") .ValueGeneratedOnAdd() .HasColumnType("datetime2") - .HasDefaultValue(new DateTime(2026, 6, 9, 2, 21, 59, 650, DateTimeKind.Local).AddTicks(161)); + .HasDefaultValue(new DateTime(2026, 6, 9, 2, 28, 45, 626, DateTimeKind.Local).AddTicks(1646)); b.Property("IsRemoved") .ValueGeneratedOnAdd() diff --git a/Complex.Infrastructure/Migrations/20260608225159_InitialCreate.cs b/Complex.Infrastructure/Migrations/20260608225845_InitialCreate.cs similarity index 96% rename from Complex.Infrastructure/Migrations/20260608225159_InitialCreate.cs rename to Complex.Infrastructure/Migrations/20260608225845_InitialCreate.cs index c5ce14c..31c5e48 100644 --- a/Complex.Infrastructure/Migrations/20260608225159_InitialCreate.cs +++ b/Complex.Infrastructure/Migrations/20260608225845_InitialCreate.cs @@ -13,8 +13,7 @@ namespace Complex.Infrastructure.Migrations name: "BasicTables", columns: table => new { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), + Id = table.Column(type: "int", nullable: false), Title = table.Column(type: "nvarchar(max)", nullable: false), Discriminator = table.Column(type: "nvarchar(max)", nullable: false) }, @@ -51,7 +50,7 @@ namespace Complex.Infrastructure.Migrations RegisterMobileNumber = table.Column(type: "nvarchar(max)", nullable: false), Body = table.Column(type: "nvarchar(max)", nullable: false), Description = table.Column(type: "nvarchar(max)", nullable: true), - InsertTime = table.Column(type: "datetime2", nullable: false, defaultValue: new DateTime(2026, 6, 9, 2, 21, 59, 646, DateTimeKind.Local).AddTicks(4981)), + InsertTime = table.Column(type: "datetime2", nullable: false, defaultValue: new DateTime(2026, 6, 9, 2, 28, 45, 624, DateTimeKind.Local).AddTicks(5016)), IsRemoved = table.Column(type: "bit", nullable: false, defaultValue: false), RemoveTime = table.Column(type: "datetime2", nullable: true), UpdateTime = table.Column(type: "datetime2", nullable: true) @@ -71,7 +70,7 @@ namespace Complex.Infrastructure.Migrations Gender = table.Column(type: "tinyint", nullable: true), Avatar = table.Column(type: "varbinary(max)", nullable: true), IsActive = table.Column(type: "bit", nullable: false), - InsertTime = table.Column(type: "datetime2", nullable: false, defaultValue: new DateTime(2026, 6, 9, 2, 21, 59, 647, DateTimeKind.Local).AddTicks(86)), + InsertTime = table.Column(type: "datetime2", nullable: false, defaultValue: new DateTime(2026, 6, 9, 2, 28, 45, 625, DateTimeKind.Local).AddTicks(1728)), IsRemoved = table.Column(type: "bit", nullable: false, defaultValue: false), RemoveTime = table.Column(type: "datetime2", nullable: true), UpdateTime = table.Column(type: "datetime2", nullable: true) @@ -100,8 +99,7 @@ namespace Complex.Infrastructure.Migrations name: "Provinces", columns: table => new { - ProvinceId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), + ProvinceId = table.Column(type: "int", nullable: false), ProvinceTitle = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => @@ -130,12 +128,11 @@ namespace Complex.Infrastructure.Migrations name: "UnitStates", columns: table => new { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), + Id = table.Column(type: "int", nullable: false), ComplexId = table.Column(type: "uniqueidentifier", nullable: true), Title = table.Column(type: "nvarchar(max)", nullable: false), Icon = table.Column(type: "nvarchar(max)", nullable: false), - InsertTime = table.Column(type: "datetime2", nullable: false, defaultValue: new DateTime(2026, 6, 9, 2, 21, 59, 650, DateTimeKind.Local).AddTicks(161)), + InsertTime = table.Column(type: "datetime2", nullable: false, defaultValue: new DateTime(2026, 6, 9, 2, 28, 45, 626, DateTimeKind.Local).AddTicks(1646)), IsRemoved = table.Column(type: "bit", nullable: false, defaultValue: false), RemoveTime = table.Column(type: "datetime2", nullable: true), UpdateTime = table.Column(type: "datetime2", nullable: true) @@ -192,8 +189,7 @@ namespace Complex.Infrastructure.Migrations name: "Cities", columns: table => new { - CityId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), + CityId = table.Column(type: "int", nullable: false), ProvinceId = table.Column(type: "int", nullable: true), CityTitle = table.Column(type: "nvarchar(max)", nullable: true) }, @@ -223,7 +219,7 @@ namespace Complex.Infrastructure.Migrations ParentId = table.Column(type: "uniqueidentifier", nullable: true), Description = table.Column(type: "nvarchar(max)", nullable: true), CityId = table.Column(type: "int", nullable: false), - InsertTime = table.Column(type: "datetime2", nullable: false, defaultValue: new DateTime(2026, 6, 9, 2, 21, 59, 646, DateTimeKind.Local).AddTicks(1882)), + InsertTime = table.Column(type: "datetime2", nullable: false, defaultValue: new DateTime(2026, 6, 9, 2, 28, 45, 623, DateTimeKind.Local).AddTicks(7632)), IsRemoved = table.Column(type: "bit", nullable: false, defaultValue: false), RemoveTime = table.Column(type: "datetime2", nullable: true), UpdateTime = table.Column(type: "datetime2", nullable: true) @@ -254,7 +250,7 @@ namespace Complex.Infrastructure.Migrations ManagerMobileNumberId = table.Column(type: "nvarchar(450)", nullable: true), StartDate = table.Column(type: "nvarchar(max)", nullable: false), EndDate = table.Column(type: "nvarchar(max)", nullable: false), - InsertTime = table.Column(type: "datetime2", nullable: false, defaultValue: new DateTime(2026, 6, 9, 2, 21, 59, 646, DateTimeKind.Local).AddTicks(3884)), + InsertTime = table.Column(type: "datetime2", nullable: false, defaultValue: new DateTime(2026, 6, 9, 2, 28, 45, 624, DateTimeKind.Local).AddTicks(2426)), IsRemoved = table.Column(type: "bit", nullable: false, defaultValue: false), RemoveTime = table.Column(type: "datetime2", nullable: true), UpdateTime = table.Column(type: "datetime2", nullable: true) @@ -279,13 +275,12 @@ namespace Complex.Infrastructure.Migrations name: "IncomeCostTitles", columns: table => new { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), + Id = table.Column(type: "int", nullable: false), Title = table.Column(type: "nvarchar(max)", nullable: true), TransactionTypeId = table.Column(type: "int", nullable: false), ComplexId = table.Column(type: "uniqueidentifier", nullable: true), RegisterMobileNumber = table.Column(type: "nvarchar(max)", nullable: true), - InsertTime = table.Column(type: "datetime2", nullable: false, defaultValue: new DateTime(2026, 6, 9, 2, 21, 59, 646, DateTimeKind.Local).AddTicks(8225)), + InsertTime = table.Column(type: "datetime2", nullable: false, defaultValue: new DateTime(2026, 6, 9, 2, 28, 45, 624, DateTimeKind.Local).AddTicks(9858)), IsRemoved = table.Column(type: "bit", nullable: false, defaultValue: false), RemoveTime = table.Column(type: "datetime2", nullable: true), UpdateTime = table.Column(type: "datetime2", nullable: true) @@ -324,7 +319,7 @@ namespace Complex.Infrastructure.Migrations StateId = table.Column(type: "int", nullable: true), Floor = table.Column(type: "int", nullable: true), ManagerDescription = table.Column(type: "nvarchar(max)", nullable: true), - InsertTime = table.Column(type: "datetime2", nullable: false, defaultValue: new DateTime(2026, 6, 9, 2, 21, 59, 649, DateTimeKind.Local).AddTicks(412)), + InsertTime = table.Column(type: "datetime2", nullable: false, defaultValue: new DateTime(2026, 6, 9, 2, 28, 45, 625, DateTimeKind.Local).AddTicks(7151)), IsRemoved = table.Column(type: "bit", nullable: false, defaultValue: false), RemoveTime = table.Column(type: "datetime2", nullable: true), UpdateTime = table.Column(type: "datetime2", nullable: true) @@ -368,7 +363,7 @@ namespace Complex.Infrastructure.Migrations EncouragementDay = table.Column(type: "int", nullable: false), EncouragementAmount = table.Column(type: "bigint", nullable: false), IncomeCostTitleId = table.Column(type: "int", nullable: true), - InsertTime = table.Column(type: "datetime2", nullable: false, defaultValue: new DateTime(2026, 6, 9, 2, 21, 59, 646, DateTimeKind.Local).AddTicks(6348)), + InsertTime = table.Column(type: "datetime2", nullable: false, defaultValue: new DateTime(2026, 6, 9, 2, 28, 45, 624, DateTimeKind.Local).AddTicks(7249)), IsRemoved = table.Column(type: "bit", nullable: false, defaultValue: false), RemoveTime = table.Column(type: "datetime2", nullable: true), UpdateTime = table.Column(type: "datetime2", nullable: true) @@ -422,7 +417,7 @@ namespace Complex.Infrastructure.Migrations UnitId = table.Column(type: "uniqueidentifier", nullable: false), TransactionId = table.Column(type: "int", nullable: true), Date = table.Column(type: "date", nullable: false), - InsertTime = table.Column(type: "datetime2", nullable: false, defaultValue: new DateTime(2026, 6, 9, 2, 21, 59, 649, DateTimeKind.Local).AddTicks(6073)), + InsertTime = table.Column(type: "datetime2", nullable: false, defaultValue: new DateTime(2026, 6, 9, 2, 28, 45, 625, DateTimeKind.Local).AddTicks(9764)), IsRemoved = table.Column(type: "bit", nullable: false, defaultValue: false), RemoveTime = table.Column(type: "datetime2", nullable: true), UpdateTime = table.Column(type: "datetime2", nullable: true) @@ -447,8 +442,7 @@ namespace Complex.Infrastructure.Migrations name: "Transactions", columns: table => new { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), + Id = table.Column(type: "bigint", nullable: false), TransactionTitleId = table.Column(type: "int", nullable: true), TransactionPersianDate = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false), TransactionDate = table.Column(type: "datetime2", nullable: false), @@ -460,7 +454,7 @@ namespace Complex.Infrastructure.Migrations ComplexId = table.Column(type: "uniqueidentifier", nullable: false), UnitCostId = table.Column(type: "bigint", nullable: false), PersonId = table.Column(type: "nvarchar(450)", nullable: false), - InsertTime = table.Column(type: "datetime2", nullable: false, defaultValue: new DateTime(2026, 6, 9, 2, 21, 59, 648, DateTimeKind.Local).AddTicks(3522)), + InsertTime = table.Column(type: "datetime2", nullable: false, defaultValue: new DateTime(2026, 6, 9, 2, 28, 45, 625, DateTimeKind.Local).AddTicks(3921)), IsRemoved = table.Column(type: "bit", nullable: false, defaultValue: false), RemoveTime = table.Column(type: "datetime2", nullable: true), UpdateTime = table.Column(type: "datetime2", nullable: true) diff --git a/Complex.Infrastructure/Migrations/ComplexDBContextModelSnapshot.cs b/Complex.Infrastructure/Migrations/ComplexDBContextModelSnapshot.cs index bf303b9..b176ef1 100644 --- a/Complex.Infrastructure/Migrations/ComplexDBContextModelSnapshot.cs +++ b/Complex.Infrastructure/Migrations/ComplexDBContextModelSnapshot.cs @@ -25,11 +25,8 @@ namespace Complex.Infrastructure.Migrations modelBuilder.Entity("Complex.Domain.Entities.BasicTable", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - b.Property("Discriminator") .IsRequired() .HasColumnType("nvarchar(max)"); @@ -75,11 +72,8 @@ namespace Complex.Infrastructure.Migrations modelBuilder.Entity("Complex.Domain.Entities.City", b => { b.Property("CityId") - .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("CityId"), 1L, 1); - b.Property("CityTitle") .HasColumnType("nvarchar(max)"); @@ -117,7 +111,7 @@ namespace Complex.Infrastructure.Migrations b.Property("InsertTime") .ValueGeneratedOnAdd() .HasColumnType("datetime2") - .HasDefaultValue(new DateTime(2026, 6, 9, 2, 21, 59, 646, DateTimeKind.Local).AddTicks(1882)); + .HasDefaultValue(new DateTime(2026, 6, 9, 2, 28, 45, 623, DateTimeKind.Local).AddTicks(7632)); b.Property("IsRemoved") .ValueGeneratedOnAdd() @@ -176,7 +170,7 @@ namespace Complex.Infrastructure.Migrations b.Property("InsertTime") .ValueGeneratedOnAdd() .HasColumnType("datetime2") - .HasDefaultValue(new DateTime(2026, 6, 9, 2, 21, 59, 646, DateTimeKind.Local).AddTicks(3884)); + .HasDefaultValue(new DateTime(2026, 6, 9, 2, 28, 45, 624, DateTimeKind.Local).AddTicks(2426)); b.Property("IsRemoved") .ValueGeneratedOnAdd() @@ -252,7 +246,7 @@ namespace Complex.Infrastructure.Migrations b.Property("InsertTime") .ValueGeneratedOnAdd() .HasColumnType("datetime2") - .HasDefaultValue(new DateTime(2026, 6, 9, 2, 21, 59, 646, DateTimeKind.Local).AddTicks(4981)); + .HasDefaultValue(new DateTime(2026, 6, 9, 2, 28, 45, 624, DateTimeKind.Local).AddTicks(5016)); b.Property("IsRemoved") .ValueGeneratedOnAdd() @@ -304,7 +298,7 @@ namespace Complex.Infrastructure.Migrations b.Property("InsertTime") .ValueGeneratedOnAdd() .HasColumnType("datetime2") - .HasDefaultValue(new DateTime(2026, 6, 9, 2, 21, 59, 646, DateTimeKind.Local).AddTicks(6348)); + .HasDefaultValue(new DateTime(2026, 6, 9, 2, 28, 45, 624, DateTimeKind.Local).AddTicks(7249)); b.Property("IsRemoved") .ValueGeneratedOnAdd() @@ -336,18 +330,15 @@ namespace Complex.Infrastructure.Migrations modelBuilder.Entity("Complex.Domain.Entities.IncomeCostTitle", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - b.Property("ComplexId") .HasColumnType("uniqueidentifier"); b.Property("InsertTime") .ValueGeneratedOnAdd() .HasColumnType("datetime2") - .HasDefaultValue(new DateTime(2026, 6, 9, 2, 21, 59, 646, DateTimeKind.Local).AddTicks(8225)); + .HasDefaultValue(new DateTime(2026, 6, 9, 2, 28, 45, 624, DateTimeKind.Local).AddTicks(9858)); b.Property("IsRemoved") .ValueGeneratedOnAdd() @@ -395,7 +386,7 @@ namespace Complex.Infrastructure.Migrations b.Property("InsertTime") .ValueGeneratedOnAdd() .HasColumnType("datetime2") - .HasDefaultValue(new DateTime(2026, 6, 9, 2, 21, 59, 647, DateTimeKind.Local).AddTicks(86)); + .HasDefaultValue(new DateTime(2026, 6, 9, 2, 28, 45, 625, DateTimeKind.Local).AddTicks(1728)); b.Property("IsActive") .HasColumnType("bit"); @@ -446,11 +437,8 @@ namespace Complex.Infrastructure.Migrations modelBuilder.Entity("Complex.Domain.Entities.Province", b => { b.Property("ProvinceId") - .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ProvinceId"), 1L, 1); - b.Property("ProvinceTitle") .HasColumnType("nvarchar(max)"); @@ -492,11 +480,8 @@ namespace Complex.Infrastructure.Migrations modelBuilder.Entity("Complex.Domain.Entities.Transaction", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnType("bigint"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - b.Property("Amount") .HasColumnType("bigint"); @@ -515,7 +500,7 @@ namespace Complex.Infrastructure.Migrations b.Property("InsertTime") .ValueGeneratedOnAdd() .HasColumnType("datetime2") - .HasDefaultValue(new DateTime(2026, 6, 9, 2, 21, 59, 648, DateTimeKind.Local).AddTicks(3522)); + .HasDefaultValue(new DateTime(2026, 6, 9, 2, 28, 45, 625, DateTimeKind.Local).AddTicks(3921)); b.Property("IsRemoved") .ValueGeneratedOnAdd() @@ -586,7 +571,7 @@ namespace Complex.Infrastructure.Migrations b.Property("InsertTime") .ValueGeneratedOnAdd() .HasColumnType("datetime2") - .HasDefaultValue(new DateTime(2026, 6, 9, 2, 21, 59, 649, DateTimeKind.Local).AddTicks(412)); + .HasDefaultValue(new DateTime(2026, 6, 9, 2, 28, 45, 625, DateTimeKind.Local).AddTicks(7151)); b.Property("IsActive") .HasColumnType("bit"); @@ -657,7 +642,7 @@ namespace Complex.Infrastructure.Migrations b.Property("InsertTime") .ValueGeneratedOnAdd() .HasColumnType("datetime2") - .HasDefaultValue(new DateTime(2026, 6, 9, 2, 21, 59, 649, DateTimeKind.Local).AddTicks(6073)); + .HasDefaultValue(new DateTime(2026, 6, 9, 2, 28, 45, 625, DateTimeKind.Local).AddTicks(9764)); b.Property("IsRemoved") .ValueGeneratedOnAdd() @@ -688,11 +673,8 @@ namespace Complex.Infrastructure.Migrations modelBuilder.Entity("Complex.Domain.Entities.UnitState", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - b.Property("ComplexId") .HasColumnType("uniqueidentifier"); @@ -703,7 +685,7 @@ namespace Complex.Infrastructure.Migrations b.Property("InsertTime") .ValueGeneratedOnAdd() .HasColumnType("datetime2") - .HasDefaultValue(new DateTime(2026, 6, 9, 2, 21, 59, 650, DateTimeKind.Local).AddTicks(161)); + .HasDefaultValue(new DateTime(2026, 6, 9, 2, 28, 45, 626, DateTimeKind.Local).AddTicks(1646)); b.Property("IsRemoved") .ValueGeneratedOnAdd()