【发布时间】:2017-09-27 17:14:25
【问题描述】:
当我运行 php artisan 迁移时。它将显示以下错误:
[Illuminate\Database\QueryException]
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'translations' already exists (SQL: create table `translations` (`
id` int unsigned not null auto_increment primary key, `table_name` varchar(191) not null, `column_name` varchar(191) not null, `f
oreign_key` int unsigned not null, `locale` varchar(191) not null, `value` text not null, `created_at` timestamp null, `updated_a
t` timestamp null) default character set utf8mb4 collate utf8mb4_unicode_ci)
[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'translations' already exists
[PDOException]
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'translations' already exists
在此之前我运行了 php artisan make:auth 命令,之后我安装了 voyager laravel 管理面板,之后我运行了 migrate 命令。
我不知道表格有什么问题。
【问题讨论】:
-
您在迁移过程中似乎不止一次运行
Schema:: create。如果要更改现有表,请使用Schema::table。
标签: php laravel laravel-5.3 laravel-artisan artisan-migrate