Script generation broken for EF 6.4.4 with dotconnect for Oracle

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
PeterUser
Posts: 40
Joined: Mon 27 Feb 2017 07:45

Script generation broken for EF 6.4.4 with dotconnect for Oracle

Post by PeterUser » Wed 08 Sep 2021 07:09

Good morning,

I am using Devart.Data.Oracle.EF6 9.14.1273 with EntityFramework 6.4.4 and see an annoying bug with sql script generation:

When I run

Code: Select all

Update-Database -Verbose -ProjectName MyProject  -ConnectionString "xxx" -ConnectionProviderName "Devart.Data.Oracle" -Script
I receive a .sql file like

Code: Select all

ALTER TABLE USER.BOX_VERSIONS
MODIFY CREATION_DATE TIMESTAMP(0) WITH TIME ZONE DEFAULT NULL

/

DECLARE


instead of the expected

Code: Select all

ALTER TABLE USER.BOX_VERSIONS
MODIFY CREATION_DATE TIMESTAMP(0) WITH TIME ZONE DEFAULT NULL
  EXECUTE IMMEDIATE 'ALTER TABLE USER.BOX_VERSIONS MODIFY CREATION_DATE NOT NULL';
EXCEPTION
  WHEN OTHERS THEN
    IF SQLCODE <> -1451 AND SQLCODE <> -1442 THEN
      RAISE;
    END IF;
END;
/

DECLARE
  BINARY_VALUE BLOB;
BEGIN
  DBMS_LOB.CREATETEMPORARY(BINARY_VALUE, TRUE);
  DBMS_LOB.APPEND(BINARY_VALUE, TO_BLOB(CAST('...' AS LONG RAW)));
  INSERT INTO USER."__MigrationHistory" ("MigrationId", "ContextKey", "Model", "ProductVersion") VALUES ('202109080628292_Test', 'Qm.Tda.Dal.Migrations.Configuration', BINARY_VALUE, '6.4.4');
END;

the missing code ends up in the Visual Studio Package Management Console. It seems like for some multiline statements only the first line is written to the file. This is especially annoying, if I have multiple of those statements in one migration, since I have to manually reorder them.

The problem occurs with both .Net Framework 4.8 and .Net 5.

Is there a way to circumvent this?

Kind regards
Peter

Shalex
Site Admin
Posts: 9358
Joined: Thu 14 Aug 2008 12:44

Re: Script generation broken for EF 6.4.4 with dotconnect for Oracle

Post by Shalex » Wed 08 Sep 2021 15:34

Thank you for your report. We have reproduced the issue and will notify you when it is fixed.

PeterUser
Posts: 40
Joined: Mon 27 Feb 2017 07:45

Re: Script generation broken for EF 6.4.4 with dotconnect for Oracle

Post by PeterUser » Thu 09 Sep 2021 07:05

Great. Thanks a lot.

It's no blocking issue, but quite inconvenient.

Have a nice day
Peter

Post Reply