Browse Source

[CI SKIP]添加约束和索引

master
wanggang 1 year ago
parent
commit
f25fc54d1e
  1. 62
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  2. 6130
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20231013022453_vmi21.Designer.cs
  3. 1212
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20231013022453_vmi21.cs
  4. 182
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs

62
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs

@ -63,6 +63,7 @@ namespace Win.Sfs.SettleAccount
//同步位置标记
builder.ConfigureSyncPositionFlag(options);
builder.ConfigureInvoiceSyncQad(options);
#endregion 基础数据
#region 北汽结算
@ -342,9 +343,9 @@ namespace Win.Sfs.SettleAccount
b.ConfigureByConvention();
});
}
#endregion 基础数据
#region 北汽
private static void ConfigureTaskJob(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
@ -1096,10 +1097,8 @@ namespace Win.Sfs.SettleAccount
//private static void ConfigureTED_SA_INV(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
//{
// builder.Entity<TED_SA_INV>(b =>
// {
// b.ToTable($"{options.TablePrefix}_TED_SA_INV", options.Schema);
// b.ConfigureByConvention();
@ -1184,24 +1183,73 @@ namespace Win.Sfs.SettleAccount
o.factory,
o.Configcode
})).IsUnique();
b.Property(o => o.RealPartCode).HasMaxLength(50);
b.HasIndex(o=>o.CreatedTime);
b.Property(o => o.OrderNum).HasMaxLength(64);
b.Property(o => o.RealPartCode).HasMaxLength(64);
b.Property(o => o.VinCode).HasMaxLength(64);
b.Property(o => o.ErpToLoc).HasMaxLength(64);
b.Property(o => o.MatchNumber).HasMaxLength(64);
b.Property(o => o.PjsNum).HasMaxLength(64);
b.Property(o => o.ReMark).HasMaxLength(128);
b.Property(o => o.factory).HasMaxLength(64);
b.Property(o => o.Seq).HasMaxLength(64);
b.Property(o => o.UniqueCode).HasMaxLength(64);
b.Property(o => o.CodeType).HasMaxLength(64);
b.Property(o => o.Configcode).HasMaxLength(64);
b.Property(o => o.SettlementPartCode).HasMaxLength(64);
}));
builder.Entity<VmiLog>(b =>
{
b.ToTable($"{options.TablePrefix}_VmiLog", options.Schema);
b.ConfigureByConvention();
b.HasIndex(o => o.ChangedTime);
b.Property(o => o.ChangedTime).HasDefaultValueSql("getdate()").ValueGeneratedOnAdd().Metadata.SetAfterSaveBehavior(PropertySaveBehavior.Ignore);
b.Property(o => o.CreatedTime).HasDefaultValueSql("getdate()").ValueGeneratedOnAdd().Metadata.SetAfterSaveBehavior(PropertySaveBehavior.Ignore);
//b.Property(o => o.UpdatedTime).HasDefaultValueSql("getdate()").ValueGeneratedOnAddOrUpdate().Metadata.SetAfterSaveBehavior(PropertySaveBehavior.Ignore);
b.Property(o => o.RealPartCode).HasMaxLength(50);
b.Property(o => o.ConcurrencyStamp).HasMaxLength(64);
b.Property(o => o.ChangedBy).HasMaxLength(64);
b.Property(o => o.ChangedNumber).HasMaxLength(64);
b.Property(o => o.CodeType).HasMaxLength(64);
b.Property(o => o.Configcode).HasMaxLength(64);
b.Property(o => o.CustPartCode).HasMaxLength(64);
b.Property(o => o.ErpToLoc).HasMaxLength(64);
b.Property(o => o.MatchNumber).HasMaxLength(64);
b.Property(o => o.OrderNum).HasMaxLength(64);
b.Property(o => o.PjsNum).HasMaxLength(64);
b.Property(o => o.ReMark).HasMaxLength(128);
b.Property(o => o.RealCode).HasMaxLength(64);
b.Property(o => o.RealPartCode).HasMaxLength(64);
b.Property(o => o.Seq).HasMaxLength(64);
b.Property(o => o.SettlementPartCode).HasMaxLength(64);
b.Property(o => o.SettlementVinCode).HasMaxLength(64);
b.Property(o => o.UniqueCode).HasMaxLength(64);
b.Property(o => o.VinCode).HasMaxLength(64);
b.Property(o => o.factory).HasMaxLength(64);
});
builder.Entity<VmiReplenished>(b =>
{
b.ToTable($"{options.TablePrefix}_VmiReplenished", options.Schema);
b.ConfigureByConvention();
b.Property(o => o.RealPartCode).HasMaxLength(50);
b.Property(o => o.ConcurrencyStamp).HasMaxLength(64);
b.Property(o => o.ChangedBy).HasMaxLength(64);
b.Property(o => o.ChangedNumber).HasMaxLength(64);
b.Property(o => o.CodeType).HasMaxLength(64);
b.Property(o => o.Configcode).HasMaxLength(64);
b.Property(o => o.CustPartCode).HasMaxLength(64);
b.Property(o => o.ErpToLoc).HasMaxLength(64);
b.Property(o => o.MatchNumber).HasMaxLength(64);
b.Property(o => o.OrderNum).HasMaxLength(64);
b.Property(o => o.PjsNum).HasMaxLength(64);
b.Property(o => o.ReMark).HasMaxLength(128);
b.Property(o => o.RealCode).HasMaxLength(64);
b.Property(o => o.RealPartCode).HasMaxLength(64);
b.Property(o => o.Seq).HasMaxLength(64);
b.Property(o => o.SettlementPartCode).HasMaxLength(64);
b.Property(o => o.SettlementVinCode).HasMaxLength(64);
b.Property(o => o.UniqueCode).HasMaxLength(64);
b.Property(o => o.VinCode).HasMaxLength(64);
b.Property(o => o.factory).HasMaxLength(64);
});
builder.Entity<VmiSnapshot>(b =>

6130
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20231013022453_vmi21.Designer.cs

File diff suppressed because it is too large

1212
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20231013022453_vmi21.cs

File diff suppressed because it is too large

182
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs

@ -4669,7 +4669,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"),
ConcurrencyStamp = "650fa7efb97a48a98ae99655da5f10b5",
ConcurrencyStamp = "094fcb0226fa43689bc1e01b7fcc4fac",
Cron = "0 0 8 26 *",
IsDisabled = false,
IsRunning = false,
@ -4679,7 +4679,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("185c5968-e02b-267e-db2f-225fccfc9716"),
ConcurrencyStamp = "887aa288e05f486a9fc47cee5c16042c",
ConcurrencyStamp = "692a0ce1268c4ad2a143785ae1ef1f32",
Cron = "0 0/1 * * * ?",
IsDisabled = false,
IsRunning = false,
@ -4689,7 +4689,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"),
ConcurrencyStamp = "beb2a2793d944668aa12b145a4fed0af",
ConcurrencyStamp = "49af54e1a4a54b1ebad0d22fbe54951a",
Cron = "0 0/1 * * * ?",
IsDisabled = false,
IsRunning = false,
@ -4699,7 +4699,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"),
ConcurrencyStamp = "8b0dcc505f594d2fae7a011bd3c9cb0b",
ConcurrencyStamp = "5572a8f023dd49139c0c23080ebb5a84",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4709,7 +4709,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"),
ConcurrencyStamp = "f7a92e81d64d410e92517b70198cb883",
ConcurrencyStamp = "52f76a1d4eac41b5afcd13c54a5007a1",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4719,7 +4719,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"),
ConcurrencyStamp = "7ad9de79ed1942d58f8bdcf0f31a0182",
ConcurrencyStamp = "577bc27326b04aafabebb3d342b907b9",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4729,7 +4729,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
ConcurrencyStamp = "d24e993891c84beead44c675d352d17c",
ConcurrencyStamp = "ea90c6a6b4a94e23ad1e7bcf7f7f9def",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4739,7 +4739,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
ConcurrencyStamp = "9db06d1651824c52ac748e70d9bdd22c",
ConcurrencyStamp = "03777851aec947d689487481665eb8b5",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4749,7 +4749,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
ConcurrencyStamp = "897a0bf76eba4d298de6997ac5451ffa",
ConcurrencyStamp = "8b834d5fc51f43f6b032565624b06ef2",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4759,7 +4759,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
ConcurrencyStamp = "2b4446c3583e4503b39f7b62d6f35701",
ConcurrencyStamp = "f9dc1b87b1454780897836ab200b5fbc",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4769,7 +4769,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
ConcurrencyStamp = "72bea3403a0a4ca5be463389628ee6fd",
ConcurrencyStamp = "3f3dd3d083ff40998c5d70a0d2e1c966",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4822,7 +4822,8 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("datetime2");
b.Property<string>("CodeType")
.HasColumnType("nvarchar(450)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
@ -4830,7 +4831,8 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("nvarchar(50)");
b.Property<string>("Configcode")
.HasColumnType("nvarchar(450)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<DateTime>("CreatedTime")
.ValueGeneratedOnAdd()
@ -4847,44 +4849,52 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("int");
b.Property<string>("ErpToLoc")
.HasColumnType("nvarchar(450)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<bool?>("IsReplenished")
.HasColumnType("bit");
b.Property<string>("MatchNumber")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("OrderNum")
.HasColumnType("nvarchar(450)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("PjsNum")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<decimal>("Qty")
.HasColumnType("decimal(18,2)");
b.Property<string>("ReMark")
.HasColumnType("nvarchar(max)");
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("RealCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("RealPartCode")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Seq")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("SettlementPartCode")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("SettlementVinCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("UniqueCode")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<DateTime>("UpdatedTime")
.ValueGeneratedOnAddOrUpdate()
@ -4892,13 +4902,17 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasDefaultValueSql("getdate()");
b.Property<string>("VinCode")
.HasColumnType("nvarchar(450)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("factory")
.HasColumnType("nvarchar(450)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.HasKey("Id");
b.HasIndex("CreatedTime");
b.HasIndex("DeliverBillType", "CodeType", "RealPartCode", "VinCode", "ErpToLoc", "OrderNum", "factory", "Configcode")
.IsUnique()
.HasFilter("[DeliverBillType] IS NOT NULL AND [CodeType] IS NOT NULL AND [RealPartCode] IS NOT NULL AND [VinCode] IS NOT NULL AND [ErpToLoc] IS NOT NULL AND [OrderNum] IS NOT NULL AND [factory] IS NOT NULL AND [Configcode] IS NOT NULL");
@ -4919,10 +4933,12 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("datetime2");
b.Property<string>("ChangedBy")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("ChangedNumber")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<decimal>("ChangedQty")
.HasColumnType("decimal(18,2)");
@ -4936,13 +4952,16 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("int");
b.Property<string>("CodeType")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Configcode")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<DateTime>("CreatedTime")
.ValueGeneratedOnAdd()
@ -4950,7 +4969,8 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasDefaultValueSql("getdate()");
b.Property<string>("CustPartCode")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<int?>("DeliverBillType")
.HasColumnType("int");
@ -4959,7 +4979,8 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("int");
b.Property<string>("ErpToLoc")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<bool?>("IsReplenished")
.HasColumnType("bit");
@ -4968,50 +4989,63 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("int");
b.Property<string>("MatchNumber")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("OrderNum")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("PjsNum")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<decimal>("Qty")
.HasColumnType("decimal(18,2)");
b.Property<string>("ReMark")
.HasColumnType("nvarchar(max)");
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("RealCode")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("RealPartCode")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Seq")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("SettlementPartCode")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("SettlementVinCode")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("UniqueCode")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<DateTime>("UpdatedTime")
.HasColumnType("datetime2");
b.Property<string>("VinCode")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("factory")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.HasKey("Id");
b.HasIndex("ChangedTime");
b.ToTable("Set_VmiLog");
});
@ -5058,10 +5092,12 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("datetime2");
b.Property<string>("ChangedBy")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("ChangedNumber")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<decimal>("ChangedQty")
.HasColumnType("decimal(18,2)");
@ -5073,19 +5109,23 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("int");
b.Property<string>("CodeType")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Configcode")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<DateTime>("CreatedTime")
.HasColumnType("datetime2");
b.Property<string>("CustPartCode")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<int?>("DeliverBillType")
.HasColumnType("int");
@ -5094,7 +5134,8 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("int");
b.Property<string>("ErpToLoc")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<bool?>("IsReplenished")
.HasColumnType("bit");
@ -5103,47 +5144,58 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("int");
b.Property<string>("MatchNumber")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("OrderNum")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("PjsNum")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<decimal>("Qty")
.HasColumnType("decimal(18,2)");
b.Property<string>("ReMark")
.HasColumnType("nvarchar(max)");
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("RealCode")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("RealPartCode")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Seq")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("SettlementPartCode")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("SettlementVinCode")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("UniqueCode")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<DateTime>("UpdatedTime")
.HasColumnType("datetime2");
b.Property<string>("VinCode")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("factory")
.HasColumnType("nvarchar(max)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.HasKey("Id");

Loading…
Cancel
Save