Browse Source

[fix]指定TraceID的长度为64,并添加数据库迁移

master
jiargcnXPS 3 years ago
parent
commit
0571b73c2d
  1. 5
      WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/DbContext/WebApiDbContextModelCreatingExtensions.cs
  2. 2909
      WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/Migrations/20220215064640_UpdateTraceIdToString.Designer.cs
  3. 104
      WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/Migrations/20220215064640_UpdateTraceIdToString.cs
  4. 32
      WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/Migrations/WebApiDbContextModelSnapshot.cs

5
WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/DbContext/WebApiDbContextModelCreatingExtensions.cs

@ -79,6 +79,7 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore
b.Property(x => x.Version).HasMaxLength(64);
b.Property(x => x.Site).IsRequired().HasMaxLength(64);
b.Property(x => x.Company).IsRequired().HasMaxLength(64);
b.Property(x => x.TraceId).IsRequired().HasMaxLength(64);
//b.Property(x => x.Color).HasMaxLength(64);
//b.Property(x => x.Configuration).HasMaxLength(64);
//b.Property(x => x.Project).HasMaxLength(64);
@ -119,6 +120,7 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore
b.Property(q => q.Company).HasMaxLength(64);
b.Property(q => q.Remark).HasMaxLength(4096);
b.Property(x => x.Bank).HasMaxLength(64);
b.Property(x => x.TraceId).IsRequired().HasMaxLength(64);
});
}
@ -180,6 +182,7 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore
b.Property(q => q.Remark).HasMaxLength(4096);
b.Property(q => q.Site).IsRequired().HasMaxLength(64);
b.Property(q => q.Company).IsRequired().HasMaxLength(64);
b.Property(x => x.TraceId).IsRequired().HasMaxLength(64);
});
}
@ -209,6 +212,7 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore
b.Property(q => q.ContactName).HasMaxLength(64);
b.Property(q => q.ContactPhone).HasMaxLength(64);
b.Property(q => q.Remark).HasMaxLength(4096);
b.Property(x => x.TraceId).IsRequired().HasMaxLength(64);
b.HasMany(u => u.Details).WithOne().HasForeignKey(rd => rd.MasterId)
.OnDelete(DeleteBehavior.NoAction).IsRequired();
@ -266,6 +270,7 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore
b.Property(q => q.Remark).HasMaxLength(4096);
b.Property(q => q.Site).IsRequired().HasMaxLength(8);
b.Property(q => q.Company).IsRequired().HasMaxLength(8);
b.Property(x => x.TraceId).IsRequired().HasMaxLength(64);
});
}

2909
WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/Migrations/20220215064640_UpdateTraceIdToString.Designer.cs

File diff suppressed because it is too large

104
WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/Migrations/20220215064640_UpdateTraceIdToString.cs

@ -0,0 +1,104 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win_in.Sfs.Scp.WebApi.Migrations
{
public partial class UpdateTraceIdToString : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "TraceId",
table: "WebApi_UnplannedReceipt",
type: "nvarchar(64)",
maxLength: 64,
nullable: false,
oldClrType: typeof(Guid),
oldType: "uniqueidentifier");
migrationBuilder.AlterColumn<string>(
name: "TraceId",
table: "WebApi_Suppliers",
type: "nvarchar(64)",
maxLength: 64,
nullable: false,
oldClrType: typeof(Guid),
oldType: "uniqueidentifier");
migrationBuilder.AlterColumn<string>(
name: "TraceId",
table: "WebApi_Receipt",
type: "nvarchar(64)",
maxLength: 64,
nullable: false,
oldClrType: typeof(Guid),
oldType: "uniqueidentifier");
migrationBuilder.AlterColumn<string>(
name: "TraceId",
table: "WebApi_PO",
type: "nvarchar(64)",
maxLength: 64,
nullable: false,
oldClrType: typeof(Guid),
oldType: "uniqueidentifier");
migrationBuilder.AlterColumn<string>(
name: "TraceId",
table: "WebApi_Part",
type: "nvarchar(64)",
maxLength: 64,
nullable: false,
oldClrType: typeof(Guid),
oldType: "uniqueidentifier");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<Guid>(
name: "TraceId",
table: "WebApi_UnplannedReceipt",
type: "uniqueidentifier",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(64)",
oldMaxLength: 64);
migrationBuilder.AlterColumn<Guid>(
name: "TraceId",
table: "WebApi_Suppliers",
type: "uniqueidentifier",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(64)",
oldMaxLength: 64);
migrationBuilder.AlterColumn<Guid>(
name: "TraceId",
table: "WebApi_Receipt",
type: "uniqueidentifier",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(64)",
oldMaxLength: 64);
migrationBuilder.AlterColumn<Guid>(
name: "TraceId",
table: "WebApi_PO",
type: "uniqueidentifier",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(64)",
oldMaxLength: 64);
migrationBuilder.AlterColumn<Guid>(
name: "TraceId",
table: "WebApi_Part",
type: "uniqueidentifier",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(64)",
oldMaxLength: 64);
}
}
}

32
WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/Migrations/WebApiDbContextModelSnapshot.cs

@ -18,7 +18,7 @@ namespace Win_in.Sfs.Scp.WebApi.Migrations
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("ProductVersion", "5.0.13")
.HasAnnotation("ProductVersion", "5.0.14")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
@ -2013,8 +2013,10 @@ namespace Win_in.Sfs.Scp.WebApi.Migrations
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<Guid>("TraceId")
.HasColumnType("uniqueidentifier");
b.Property<string>("TraceId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Type")
.HasMaxLength(64)
@ -2115,8 +2117,10 @@ namespace Win_in.Sfs.Scp.WebApi.Migrations
.HasPrecision(18, 6)
.HasColumnType("decimal(18,6)");
b.Property<Guid>("TraceId")
.HasColumnType("uniqueidentifier");
b.Property<string>("TraceId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Version")
.IsRequired()
@ -2299,8 +2303,10 @@ namespace Win_in.Sfs.Scp.WebApi.Migrations
.HasPrecision(18, 6)
.HasColumnType("decimal(18,6)");
b.Property<Guid>("TraceId")
.HasColumnType("uniqueidentifier");
b.Property<string>("TraceId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Uom")
.IsRequired()
@ -2410,8 +2416,10 @@ namespace Win_in.Sfs.Scp.WebApi.Migrations
.HasMaxLength(4096)
.HasColumnType("nvarchar(max)");
b.Property<Guid>("TraceId")
.HasColumnType("uniqueidentifier");
b.Property<string>("TraceId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.HasKey("Id");
@ -2502,8 +2510,10 @@ namespace Win_in.Sfs.Scp.WebApi.Migrations
.HasMaxLength(8)
.HasColumnType("nvarchar(8)");
b.Property<Guid>("TraceId")
.HasColumnType("uniqueidentifier");
b.Property<string>("TraceId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Uom")
.IsRequired()

Loading…
Cancel
Save