Skip to content

Commit

Permalink
Merge pull request #17979 from abpframework/EntityId
Browse files Browse the repository at this point in the history
Remove `Required` constraints of `EntityChange's EntityId`.
  • Loading branch information
realLiangshiwei committed Nov 1, 2023
2 parents 0a1d688 + eb1959d commit a750f00
Show file tree
Hide file tree
Showing 25 changed files with 33 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static class AbpAuditLoggingDbContextModelBuilderExtensions
b.ConfigureByConvention();
b.Property(x => x.EntityTypeFullName).HasMaxLength(EntityChangeConsts.MaxEntityTypeFullNameLength).IsRequired().HasColumnName(nameof(EntityChange.EntityTypeFullName));
b.Property(x => x.EntityId).HasMaxLength(EntityChangeConsts.MaxEntityIdLength).IsRequired().HasColumnName(nameof(EntityChange.EntityId));
b.Property(x => x.EntityId).HasMaxLength(EntityChangeConsts.MaxEntityIdLength).HasColumnName(nameof(EntityChange.EntityId));
b.Property(x => x.AuditLogId).IsRequired().HasColumnName(nameof(EntityChange.AuditLogId));
b.Property(x => x.ChangeTime).IsRequired().HasColumnName(nameof(EntityChange.ChangeTime));
b.Property(x => x.ChangeType).IsRequired().HasColumnName(nameof(EntityChange.ChangeType));
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
ChangeTime = table.Column<DateTime>(type: "datetime2", nullable: false),
ChangeType = table.Column<byte>(type: "tinyint", nullable: false),
EntityTenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
EntityId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
EntityId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
EntityTypeFullName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
.HasAnnotation("ProductVersion", "8.0.0-rc.1.23419.6")
.HasAnnotation("ProductVersion", "8.0.0-rc.2.23480.1")
.HasAnnotation("Relational:MaxIdentifierLength", 128);

SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
Expand Down Expand Up @@ -215,7 +215,6 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnName("ChangeType");
b.Property<string>("EntityId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)")
.HasColumnName("EntityId");
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
ChangeTime = table.Column<DateTime>(type: "datetime2", nullable: false),
ChangeType = table.Column<byte>(type: "tinyint", nullable: false),
EntityTenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
EntityId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
EntityId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
EntityTypeFullName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
.HasAnnotation("ProductVersion", "8.0.0-rc.1.23419.6")
.HasAnnotation("ProductVersion", "8.0.0-rc.2.23480.1")
.HasAnnotation("Relational:MaxIdentifierLength", 128);

SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
Expand Down Expand Up @@ -215,7 +215,6 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnName("ChangeType");
b.Property<string>("EntityId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)")
.HasColumnName("EntityId");
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
ChangeTime = table.Column<DateTime>(type: "datetime2", nullable: false),
ChangeType = table.Column<byte>(type: "tinyint", nullable: false),
EntityTenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
EntityId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
EntityId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
EntityTypeFullName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
.HasAnnotation("ProductVersion", "8.0.0-rc.1.23419.6")
.HasAnnotation("ProductVersion", "8.0.0-rc.2.23480.1")
.HasAnnotation("Relational:MaxIdentifierLength", 128);

SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
Expand Down Expand Up @@ -215,7 +215,6 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnName("ChangeType");
b.Property<string>("EntityId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)")
.HasColumnName("EntityId");
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
ChangeTime = table.Column<DateTime>(type: "datetime2", nullable: false),
ChangeType = table.Column<byte>(type: "tinyint", nullable: false),
EntityTenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
EntityId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
EntityId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
EntityTypeFullName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
.HasAnnotation("ProductVersion", "8.0.0-rc.1.23419.6")
.HasAnnotation("ProductVersion", "8.0.0-rc.2.23480.1")
.HasAnnotation("Relational:MaxIdentifierLength", 128);

SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
Expand Down Expand Up @@ -215,7 +215,6 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnName("ChangeType");
b.Property<string>("EntityId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)")
.HasColumnName("EntityId");
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
ChangeTime = table.Column<DateTime>(type: "datetime2", nullable: false),
ChangeType = table.Column<byte>(type: "tinyint", nullable: false),
EntityTenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
EntityId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
EntityId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
EntityTypeFullName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
.HasAnnotation("ProductVersion", "8.0.0-rc.1.23419.6")
.HasAnnotation("ProductVersion", "8.0.0-rc.2.23480.1")
.HasAnnotation("Relational:MaxIdentifierLength", 128);

SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
Expand Down Expand Up @@ -215,7 +215,6 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnName("ChangeType");
b.Property<string>("EntityId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)")
.HasColumnName("EntityId");
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
ChangeTime = table.Column<DateTime>(type: "datetime2", nullable: false),
ChangeType = table.Column<byte>(type: "tinyint", nullable: false),
EntityTenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
EntityId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
EntityId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
EntityTypeFullName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
.HasAnnotation("ProductVersion", "8.0.0-rc.1.23419.6")
.HasAnnotation("ProductVersion", "8.0.0-rc.2.23480.1")
.HasAnnotation("Relational:MaxIdentifierLength", 128);

SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
Expand Down Expand Up @@ -215,7 +215,6 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnName("ChangeType");
b.Property<string>("EntityId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)")
.HasColumnName("EntityId");
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a750f00

Please sign in to comment.