Postgresql has a limit of 63 characters - relationships
Postgresql has a limit of 63 characters - relationships
I am using dotConnect for Postgresql and I am having a problem with the way entity framework code first generates table relationship names. The convention seems to be < ChildTableName>_<ParentTableName>_<Column>. Since my table and column names are long this results in long relationship names. Postgresql has a limit of 63 characters for identifiers so this causes a problem for me. Is there a way to modify this convention? If not, what other options (apart from using shorter table and column names) do I have?
Re: Postgresql has a limit of 63 characters - relationships
There is a config.CodeFirstOptions.TruncateLongDefaultNames configuration option, which is used to provide the possibility of truncating long default names of indexes, primary keys, foreign keys, triggers, and sequences generated by Code-First Migrations.
Please refer to http://www.devart.com/dotconnect/postgr ... tions.html.
For example, you can do it in the code:
Also, you can do it in the config file. For example:
Please tell us if this helps.
Please refer to http://www.devart.com/dotconnect/postgr ... tions.html.
For example, you can do it in the code:
Code: Select all
var config = Devart.Data.PostgreSql.Entity.Configuration.PgSqlEntityProviderConfig.Instance;
config.CodeFirstOptions.TruncateLongDefaultNames = true;
Code: Select all
<configSections>
<section name="Devart.Data.PostgreSql.Entity" type="Devart.Data.PostgreSql.Entity.Configuration.PgSqlEntityProviderConfigurationSection,
Devart.Data.PostgreSql.Entity, Version=7.3.161.6, Culture=neutral, PublicKeyToken=09af7300eec23701" />
</configSections>
<Devart.Data.PostgreSql.Entity xmlns="http://devart.com/schemas/Devart.Data.PostgreSql.Entity/1.0">
<CodeFirstOptions TruncateLongDefaultNames="true" />
</Devart.Data.PostgreSql.Entity>
</configuration>