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

.Indexed() and .Unique() do nothing #39

Closed
ceilidhboy opened this issue Oct 18, 2010 · 2 comments · Fixed by #207
Closed

.Indexed() and .Unique() do nothing #39

ceilidhboy opened this issue Oct 18, 2010 · 2 comments · Fixed by #207
Labels
Milestone

Comments

@ceilidhboy
Copy link

Working against SqlServer, adding .Indexed() or .Unique() when creating a table's columns don't do anything.

I'm surprised this bug got this far. Surely an index is a pretty common requirement?

@jsadeli
Copy link

jsadeli commented Mar 16, 2011

I can confirm that UNIQUE column constraint not applied/created when working with SQLite. FluentMigrator v1.0

@pkrakowiak
Copy link
Contributor

Same with PostgreSQL, .Unique() called in the create table method chain doesn't add any constraints in the generated SQL. This works as an alternative:

Create.Index("uq_category_name").OnTable(CATEGORIES_TABLE).OnColumn("name").Ascending().WithOptions().Unique();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants