2

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?

  • Sounds like an issue. Try over at Oracle’s official forums: https://community.oracle.com/tech/developers/categories/odp.net – David Browne - Microsoft Jun 02 '22 at 15:21
  • 1
    Thanks @DavidBrowne-Microsoft I posted a question already there, but I wanted to double-check whether this could be general EF problem, or an issue related to the DB provider package. – Piotr Lewandowski Jun 08 '22 at 07:12
  • @PiotrLewandowski you mentioned the devart tag. If the issue persists with Devart.Data.Oracle.EFCore as well, please submit the request via https://www.devart.com/company/contactform.html – Devart Oct 05 '22 at 13:16
  • Did you solve this issue, I encounter the same problem – pirimoglu Aug 18 '23 at 05:32

0 Answers0