mysql-workbench-export-laravel-5-migrations icon indicating copy to clipboard operation
mysql-workbench-export-laravel-5-migrations copied to clipboard

Unique indexes are not created correctly

Open JonoB opened this issue 8 years ago • 1 comments

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');

JonoB avatar Feb 15 '17 11:02 JonoB

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

VeeeneX avatar Feb 20 '17 22:02 VeeeneX