FK names problem

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
entwicklungsensis
Posts: 17
Joined: Tue 21 Aug 2018 09:47

FK names problem

Post by entwicklungsensis » Wed 13 Nov 2019 14:42

Hello,
we are using \.nuget\packages\devart.data.oracle.efcore\9.7.805

We are using working on a model first relational database model.
We are creating and migrating the database with "dotnet ef" commands in package-manager-console.
When we use "Update database from Model" for looking at the generated script there are many differences between the database and the model. much more differences than in the ef generated migration class.
for example:
In the generated script form Devart Entity Developer we found:

-- Script was generated by Devart Entity Developer, Version 6.4.790.0
-- Script date 13.11.2019 15:36:10
-- Target Server: Oracle
-- Server Version:

--
-- Altering a table NPS."WiegescheinAnhang"
--
ALTER TABLE NPS."WiegescheinAnhang"
DROP CONSTRAINT "FK_WiegescheinAnha_01534592935";

Now looking at the Table "WiegescheinAnhang" there is no Constraint with that name but one named "FK_WiegescheinAnhang_Wiegeschein_WiegescheinId" which is correct because we have set TruncateLongDefaultNames to false:

public partial class TocanNpsModel
{
partial void CustomizeConfiguration(ref DbContextOptionsBuilder optionsBuilder)
{
OracleEntityProviderConfig.Instance.CodeFirstOptions.TruncateLongDefaultNames = false;
}


"dotnet ef migrations add xxx" generates the correct FK Name. Entity developer does not.
Is this a bug or did we miss something?

Regards
Thomas

entwicklungsensis
Posts: 17
Joined: Tue 21 Aug 2018 09:47

Re: FK names problem

Post by entwicklungsensis » Mon 18 Nov 2019 08:56

Hello devart team,
anyone has an answer to this?

Thomas

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

Re: FK names problem

Post by Shalex » Mon 18 Nov 2019 17:04

The version of your Oracle Server is 12.2 or higher, isn't it?

We have reproduced the issue with truncating long names to 30 symbols by Entity Developer for Oracle Server 12.2 and higher. We will notify you when the problem is fixed.

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

Re: FK names problem

Post by Shalex » Tue 24 Dec 2019 19:54

dotConnect for Oracle v9.10.909 includes the following fixes:
* The 12cR2 option is added to the list of available Oracle versions in Model Synchronization Settings
* The bug with truncating long names to 30 symbols for Oracle Server 12.2 and higher by Update To Database Wizard / Generate Database Script Wizard is fixed

Refer to viewtopic.php?f=1&t=39716.

Post Reply