DropIndex Ommits架构在通过EntityFramework CodeFirst生成迁移脚本时
通过命令行,脚本迁移或dotnet ef迁移脚本,我从现有迁移文件中生成迁移脚本有问题。
迁移文件包含以下内容:
migrationBuilder.DropIndex(
name: "IX_CAR_CAR_ID",
schema: "AUTO",
table: "CARS",
column: "CAR_ID");
生成的SQL脚本包含在数据库更新过程中失败的SQL。
:
应在drop索引命令中包含架构:drop索引“ auto”。
预期结果
sql脚本 在drop索引命令中不包含架构:drop索引“ ix_car_car_id”
我已经通过手动修改迁移文件修改了该架构,因此,而不是MigrationBuilder.DropIndex,I使用
migration> migration> migrationbuilder.sql(” drop index \“ auto \”。\ \“ ix_car_car_id \”)。
好吧,这为我解决了问题,但我想没有删除原因。
我尝试使用MSSQL Server相同,结果是有效的:
drop index [ix_car_car_id]在[auto]上。[cars];
> 因此,我认为这可能是仅相关的问题。
使用:
Microsoft.EntityFrameWorkCore版本5.0.17
Oracle.EntityFrameWorkCore版本5.21.61
我的问题:任何人知道这是否可能是Oracle或EntityFramework软件包之一中的错误?
I have a problem with generating migration script from existing migration files, via command line, either Script-Migration or dotnet ef migrations script.
The migration file contains the following:
migrationBuilder.DropIndex(
name: "IX_CAR_CAR_ID",
schema: "AUTO",
table: "CARS",
column: "CAR_ID");
The generated SQL script contains SQL that fails during database update.
Expected result:
SQL script should contain schema in the drop index command: DROP INDEX "AUTO"."IX_CAR_CAR_ID"
Actual result:
SQL script does not contain schema in the drop index command: DROP INDEX "IX_CAR_CAR_ID"
I have fixed that by manual modification of the migration file, so instead of migrationBuilder.DropIndex, I use
migrationBuilder.Sql("DROP INDEX \"AUTO\".\"IX_CAR_CAR_ID\"").
Well, that solves the problem for me, but does not remove the cause, I suppose.
I have tried the same with MsSQL server and the result is valid:
DROP INDEX [IX_CAR_CAR_ID] ON [AUTO].[CARS];
so, I assume it might be Oracle only related issue.
Using:
Microsoft.EntityFrameworkCore version 5.0.17
Oracle.EntityFrameworkCore version 5.21.61
My question: does anybony know whether this could be a bug in one of the Oracle or EntityFramework packages?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论