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?