Open kinzinho666 opened 4 years ago
git clone... composer install .... .env change... php artisan key:generate ... php artisan migrate...
Error: SQLSTATE[HY000]: General error: 1005 Can't create table pcweb.roles_permissions (errno: 150 "Foreign key constraint is incorrectly formed") (SQL: alter table roles_permissions add constraint roles_permissions_role_id_foreign foreign key (role_id) references roles (id) on delete cascade)
pcweb
roles_permissions
roles_permissions_role_id_foreign
role_id
roles
id
Solution:
rename: 2020_05_19_193413_create_permissions_table to 2020_05_19_190403_create_permissions_table
modify in all migrations files error: remove: $table->bigIncrements(FIELD... use: $table->bigInteger('FIELD')->unsigned();
git clone... composer install .... .env change... php artisan key:generate ... php artisan migrate...
Error: SQLSTATE[HY000]: General error: 1005 Can't create table
pcweb
.roles_permissions
(errno: 150 "Foreign key constraint is incorrectly formed") (SQL: alter tableroles_permissions
add constraintroles_permissions_role_id_foreign
foreign key (role_id
) referencesroles
(id
) on delete cascade)Solution:
rename: 2020_05_19_193413_create_permissions_table to 2020_05_19_190403_create_permissions_table
modify in all migrations files error: remove: $table->bigIncrements(FIELD... use: $table->bigInteger('FIELD')->unsigned();