kodeine/laravel-acl

Need fix foreign key table name

chiricomarco opened this issue · 4 comments

In this file: /src/migrations/2015_02_07_172633_create_role_user_table.php - need to change the follow part of code:

before:
$table->foreign('user_id')
->references('id')
->on()
->onDelete('cascade');

after:
$table->foreign('user_id')
->references('id')
->on($this->prefix . 'users')
->onDelete('cascade');

Cheers
Marco

@chiricomarco thnx man! You're saved my time!

Hey guys. I have too add in the file: /src/migrations/2015_02_17_152439_create_permission_user_table
I verify in database and don't relashions key in the tables.
...
$table->foreign('permission_id')
->references('id')
->on($this->prefix . 'permissions')
->onDelete('cascade');
$table->foreign('user_id')
->references('id')
->on($this->prefix . 'users')
->onDelete('cascade');

GiTsu commented

problem still exists on fresh v6.0 installation. laravel-acl version = 2.0.3. I had to manually edit migration file in vendor dir

@GiTsu, @chiricomarco can you please submit the PR?