Skip to content

Allow columns index be shared between base and subclass properties #2101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 29, 2019

Conversation

bahusoid
Copy link
Member

@bahusoid bahusoid commented Apr 3, 2019

Fixes #2099

@bahusoid bahusoid changed the title Allow columns index be shared between base and subclass properties WIP Allow columns index be shared between base and subclass properties Apr 4, 2019
bahusoid added 2 commits April 4, 2019 09:28
…se for now true only for PostgreSQL)

Support 2+ levels of inheritance for index
@@ -68,7 +68,8 @@ public static string BuildSqlDropIndexString(Dialect.Dialect dialect, Table tabl
/// </returns>
public string SqlCreateString(Dialect.Dialect dialect, IMapping p, string defaultCatalog, string defaultSchema)
{
return BuildSqlCreateIndexString(dialect, Name, Table, ColumnIterator, false, defaultCatalog, defaultSchema);
var indexName = IsInherited ? Table.Name + Name : Name;
Copy link
Member Author

@bahusoid bahusoid Apr 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible improvement: avoid changing index name for dialects where same index name is allowed for different tables.
According to my tests dialects that require unique index name in database:
Firebird
Oracle
SQLite
PostgreSQL

Support same index name:
SQL Server
SQL Server CE
MySql
SAP SQL Anywhere

@bahusoid bahusoid changed the title WIP Allow columns index be shared between base and subclass properties Allow columns index be shared between base and subclass properties Apr 4, 2019
@ValResnick
Copy link

Can i do something here to close this PR ?

@hazzik hazzik merged commit d0aecf2 into nhibernate:master May 29, 2019
@hazzik hazzik added this to the 5.3 milestone May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Composite Index" not working with inheritance
4 participants