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

Unique indexes are not created correctly #36

Open
JonoB opened this issue Feb 15, 2017 · 1 comment
Open

Unique indexes are not created correctly #36

JonoB opened this issue Feb 15, 2017 · 1 comment

Comments

@JonoB
Copy link
Contributor

JonoB commented Feb 15, 2017

If you have multiple unique indexes on a table, then this plugin incorrectly concatenates them, instead of creating separate indexes.

$table->unique(["email", "username", "uuid"], 'unique_users');

The problem here is that laravel is trying to create a composite unique index across all those fields. It should instead be:

$table->unique("email", 'unique_users_email');
$table->unique("username", 'unique_users_username');
$table->unique("uuid", 'unique_users_uuid');
@VeeeneX
Copy link
Collaborator

VeeeneX commented Feb 20, 2017

@JonoB But sometimes composite indexes are needed, I will look at it

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

2 participants