In This Topic
dotConnect for PostgreSQL includes settings for configuring DDL generation in Entity Framework Code First. The following settings are available.
RemoveSchemaFromDefaultConstraintName - When set to true, the schema (database) name prefix is removed from default constraint names (primary keys, foreign keys) generated by Code-First Migrations. Default value is true.
- AddTableNameInDefaultIndexName - When set to true, the table name is added to default index name generated by Code-First Migrations (like 'IX_TableName_ColumnName').
When set to false, then default index names will be like 'IX_ColumnName'.
Default value is true.
- TruncateLongDefaultNames - When set to true, long default names of indexes, primary keys, and foreign keys,
generated by Code-First Migrations, will be truncated if they exceed the limit of 63 characters. This option does not affect the truncation of long default names generated by Code-First CreateDatabase() and DropDatabase() functionality.
They are always truncated if they exceed the limit of 63 characters.
However it affects the algorithm of this truncation and renaming of these identifiers.
When it is set to true, the names of these identifiers are identical both in Code-First CreateDatabase() and in Code-First Migrations.
Default value is true.
These options can be set either in code as the properties of the EntityProviderConfig.CodeFirstOptions object or in the project config file as the attributes of the CodeFirstOptions element of the Devart.Data.PostgreSql.Entity tag.