源码

php – 如何在laravel 5.5中进行迁移?


我用laravel 5.5创建了一个Auth项目并创建了新的迁移,当我迁移时,我收到了这个错误信息:

在Connection.php第647行:

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists
(SQL: create table `users` (
      `id` int unsigned not null auto_increment primary key,
      `name` varchar(255) not null,
      `username` varchar(255) not null,
      `email` varchar(255) not null,
      `password` varchar(255) not null,
      `remember_token` varchar(100) null,
      `created_at` timestamp null,
      `updated_at` timestamp null,
      `role` int not null
      ) default character set utf8mb4 collate utf8mb4_unicode_ci
)

在Connection.php第449行:

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists

我尝试php artisan migrate –force和php artisan migrate:rollback

并尝试删除所有表格并再次迁移它仍然是这个错误

(0)

本文由 投稿者 创作,文章地址:https://blog.isoyu.com/archives/php-ruhezailaravel-5-5zhongjinxingqianyi.html
采用知识共享署名4.0 国际许可协议进行许可。除注明转载/出处外,均为本站原创或翻译,转载前请务必署名。最后编辑时间为:9月 26, 2019 at 03:58 上午

热评文章