将索引缩短为 IX_CE_Offering_Status_WaitlistedAt。
将候补迁移改为可重入:先检查列和索引是否存在,再执行 DDL。 附件中已经成功添加 WaitlistedAt、但索引创建失败的数据库可直接重试,不会报重复列。 运行时和 dotnet ef 连接统一开启 AllowUserVariables;Connector/NET 默认关闭该选项。Connector/NET 官方说明 增加所有 MySQL 索引名不得超过 64 字符的回归测试。
This commit is contained in:
+2
-1
@@ -745,7 +745,8 @@ namespace Jiaowu.Api.Infrastructure.Persistence.Migrations.MySql
|
||||
|
||||
b.HasIndex("StudentId", "Status");
|
||||
|
||||
b.HasIndex("CourseSelectionOfferingId", "Status", "WaitlistedAt");
|
||||
b.HasIndex("CourseSelectionOfferingId", "Status", "WaitlistedAt")
|
||||
.HasDatabaseName("IX_CE_Offering_Status_WaitlistedAt");
|
||||
|
||||
b.ToTable("CourseEnrollments");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user