mysql-workbench-export-laravel-5-migrations
mysql-workbench-export-laravel-5-migrations copied to clipboard
Unique indexes are not created correctly
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 But sometimes composite indexes are needed, I will look at it