Oracle.EntityFrameworkCore generates invalid idempotent migrations SQL — oracle-tech

    Forum Stats

  • 3,715,657 Users
  • 2,242,821 Discussions
  • 7,845,481 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Oracle.EntityFrameworkCore generates invalid idempotent migrations SQL

31c07350-bada-4691-ae39-0c5ef56be3b6
edited September 2019 in ODP.NET

Background: We are using Entity Framework (EF) Core version 2.2.6 with the NuGet package Oracle.EntityFrameworkCore version 2.19.30

We are generating an idempotent migrations SQL script using the command line: dotnet ef migrations script --idempotent --output "Update-Database.sql"

The SQL file is generated, but when we execute it using SQL*Plus then it shows many errors because the SQL is invalid.

In particular, we have identified the following errors in the generated SQL:

  1. When it creates the __EFMigrationsHistory table then it raises the exception if the code is not 942.  Based on our environment, instead of 942 it should check against 955 instead.
  2. At the end of the SELECT COUNT(*) INTO v_Count FROM lines there should be a semicolon.
  3. At the end of the END IF and END lines there should be a semicolon.
  4. At the end of the INSERT INTO SQL there should be a semicolon.

Please can you fix the NuGet package Oracle.EntityFrameworkCore and publish a new version with these fixes.  Thank you!

Sign In or Register to comment.