Laravelでテーブルを追加してmigrateしたのですが、mysqlにアクセスしてみると、テーブルがありませんでした。
原因が分からず、rollback後ファイルを削除し、再度テーブルを作ってmigrateしたところ、
Migrating: 2020_10_03_140810_create_categories_table
Illuminate\Database\QueryException : SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'created_at' (SQL: create table categories
(id
bigint unsigned not null auto_increment primary key, name
varchar(255) not null, created_at
timestamp not null, updated_at
timestamp not null, created_at
timestamp null, updated_at
timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')
というエラーが発生してしまいました。
カラムが既にある、という内容のようですが、対処法がなかなか見付かりません。
データベースを再構築する以外の対処法はありますでしょうか。
回答1件
あなたの回答
tips
プレビュー