Problem setting TruncateLongDefaultNames
Posted: Tue 22 Jan 2013 14:20
Hello, I am trying to do a code-first migration against an oracle database using dotConnect for oracle.
Some indexes are composed of many columns and the generated name becomes something like:IX_ProductID_VersionLevel1_xxxxxxxxxxx_yyyyyyyyyyy_zzzzzzzzzzzzzzzzzz
This gives of course an error about the index name length being too long, because of ORacle 30 char limit, when running Update-Database from package manager console.
I found the option
Which I thought would truncate the long names.
So in the static constructor of my class inheriting from DbContext i put:
This had little effect.
Just for kicks, I tried setting the option:
true/false and then I saw that this value actually was taken into account, because another error message occured (something that was too long passed when turned off)
I then tried setting this options in the App.config of my DbContext project (using it as startup project for code first migration)
I added the configsection:
And the following config:
I then saw the same behavior, the AddTableNameInDefaultIndexName worked, but the TruncateLongDefaultNames had little effect.
Am I doing something wrong?
Some indexes are composed of many columns and the generated name becomes something like:IX_ProductID_VersionLevel1_xxxxxxxxxxx_yyyyyyyyyyy_zzzzzzzzzzzzzzzzzz
This gives of course an error about the index name length being too long, because of ORacle 30 char limit, when running Update-Database from package manager console.
I found the option
Code: Select all
CodeFirstOptions.TruncateLongDefaultNames = true;
So in the static constructor of my class inheriting from DbContext i put:
Code: Select all
OracleEntityProviderConfig.Instance.CodeFirstOptions.TruncateLongDefaultNames = true;
Just for kicks, I tried setting the option:
Code: Select all
CodeFirstOptions.AddTableNameInDefaultIndexName = false;
I then tried setting this options in the App.config of my DbContext project (using it as startup project for code first migration)
I added the configsection:
Code: Select all
<section name="Devart.Data.Oracle.Entity" type="Devart.Data.Oracle.Entity.Configuration.OracleEntityProviderConfigurationSection, Devart.Data.Oracle.Entity, Version=7.5.164.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
Code: Select all
<Devart.Data.Oracle.Entity xmlns="http://devart.com/schemas/Devart.Data.Oracle.Entity/1.0">
<CodeFirstOptions TruncateLongDefaultNames="true" AddTableNameInDefaultIndexName="false"/>
</Devart.Data.Oracle.Entity>
Am I doing something wrong?