Laravel 5.2 Zizaco/entrust 无法生存数据库
程序员文章站
2022-06-01 17:12:05
...
Laravel Framework version 5.2.31 按照Github上的说明,一步步配置的,到执行php artisan migrate 时会报错:
[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table nam
e '' (SQL: alter table `role_user` add constraint `role_user_user_id_foreig
n` foreign key (`user_id`) references `` (`id`) on delete cascade on update
cascade)
[PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table nam
e ''
查看数据库中的表,只创建了roles和role_user两个表!
回复内容:
Laravel Framework version 5.2.31 按照Github上的说明,一步步配置的,到执行php artisan migrate 时会报错:
[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table nam
e '' (SQL: alter table `role_user` add constraint `role_user_user_id_foreig
n` foreign key (`user_id`) references `` (`id`) on delete cascade on update
cascade)
[PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table nam
e ''
查看数据库中的表,只创建了roles和role_user两个表!
看这里