Skip to content
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

Handle redundant PK indexes in RelationalScaffoldingModelFactory #3664

Closed
natemcmaster opened this issue Nov 5, 2015 · 7 comments
Closed

Comments

@natemcmaster
Copy link
Contributor

Most databases contain a unique index to represent primary key constraint. Currently, SqlServer and Sqlite filter these indexes at the DatabaseModelFactory so that RelationalScaffoldingModelFactory does not add these to the scaffolding model. It would be more useful to prevent adding this redundant indexes to the ScaffoldingModel in our base implementation (RelationalScaffoldingModelFactory).

@natemcmaster
Copy link
Contributor Author

cc @lajones Did you already start work on something similar to this?

@lajones
Copy link
Contributor

lajones commented Nov 5, 2015

@natemcmaster sorry, no, can't find anything on that.

@smitpatel
Copy link
Contributor

Currently Sqlite doesn't filter Indexes defined on PK (#3642) unless it has been fixed.

@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 5, 2015

@natemcmaster Actually I did not filter them out, and it did not affect Fluent API scaffolding!?

@rowanmiller
Copy link
Contributor

Created a task to look at the all-up design around indexes (and listed this as an item that needs attention).

@lajones
Copy link
Contributor

lajones commented Nov 11, 2015

Note: we do filter out indexes which match the PK properties much later in the process in ModelConfiguration.AddIndexConfigurations(). This applies to all providers - but note the SQL Server provider has already removed them in SqlServerDatabaseModelFactory.GetIndexes().

@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 11, 2015

Great, as noted this works fine for me!

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants