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

Need fix foreign key table name #246

Open
chiricomarco opened this issue Dec 6, 2019 · 4 comments
Open

Need fix foreign key table name #246

chiricomarco opened this issue Dec 6, 2019 · 4 comments

Comments

@chiricomarco
Copy link

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

@SnusnumrConceit
Copy link

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

@developerdelphi
Copy link

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
Copy link

GiTsu commented Mar 9, 2020

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

@kodeine
Copy link
Owner

kodeine commented Apr 3, 2020

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

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

5 participants