kodeine/laravel-acl

CreateUsersTable Migration Conflicts With Laravel's Default

fulopattila122 opened this issue · 3 comments

The following migration file within this package: 2016_02_06_172606_create_users_table.php conflicts with Laravel's default CreateUsersTable migration.

When you publish Acl's migrations, run them and you try to rollback (any other) migration at a later time, artisan throws a duplicate class name CreateUsersTable exception.

I guess Acl's own create users table migration should have a different, compatible class name. Like CreateUsersTableIfNotExists. Laravel's own migration is definitely present in the vast majority of Laravel applications.

Over 2 years on this, any chance of this getting resolved? Seems like an easy enough fix.

Okay, so I see why this isn't an easy fix. Attempting to fix this myself, I see a couple issues:

  1. Class names for migrations are the same
  2. Can't execute migration for setting up user roles as the default users table created by Laravel uses big int primary key, which the migrations use
  3. Supposing you just modify the primary key type, you'll then run into the error when it tries to change the foreign key reference to big int

Seems like the only way to fix this is to have a destructive migration process. There should at least be documentation around this for users using the default users migration from laravel

Apparently I'm not the first to encounter this: #145