laravel-acl icon indicating copy to clipboard operation
laravel-acl copied to clipboard

Need fix foreign key table name

Open chiricomarco opened this issue 5 years ago • 4 comments
trafficstars

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 avatar Dec 06 '19 17:12 chiricomarco

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

SnusnumrConceit avatar Dec 27 '19 21:12 SnusnumrConceit

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

developerdelphi avatar Jan 12 '20 02:01 developerdelphi

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 avatar Mar 09 '20 18:03 GiTsu

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

kodeine avatar Apr 03 '20 15:04 kodeine