Open roji opened 8 years ago
From @adraut on March 18, 2015 0:47
@azhozhin What is wrong with the index name? It is being generated inline with PostgreSQL's default index naming.
From @azhozhin on March 18, 2015 5:17
@adraut I want to control by myself naming convention here using IndexAttributeConvention
and
ForeignKeyIndexConvention
but not be forced by Npgsql.EntityFramework.
There is SqlServerMigrationSqlGenerator implementation:
protected virtual void Generate(CreateIndexOperation createIndexOperation)
{
Check.NotNull<CreateIndexOperation>(createIndexOperation, "createIndexOperation");
using (IndentedTextWriter writer = SqlServerMigrationSqlGenerator.Writer())
{
writer.Write("CREATE ");
...
writer.Write("INDEX ");
writer.Write(this.Quote(createIndexOperation.Name));
writer.Write(" ON ");
...
}
}
As a result I want index name like IX_[Table]_[Column]
, using one of mentioned above conventions I can archive it.
From @azhozhin on March 17, 2015 8:31
in Npgsql.EntityFramework\NpgsqlMigrationSqlGenerator.cs code responsible for index name:
produces weird names such as
Product_IX_ProductName
instead ofIX_ProductName
for migration:
Copied from original issue: npgsql/npgsql#538