FK names problem
Posted: 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
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