私はLaravel Framework version 5.2.45
を実行しており、データベースの移行を移行したいと考えています。Laravel Migrations - 列は既に存在します
2つの移行があります。 (ロールバックする前に)典型的なphp artisan migrate
は私が手行う
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateKeywordsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('keywords', function (Blueprint $table) {
$table->increments('id');
$table->string('keyword');
$table->timestamps();
$table->timestamps('published_at');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('keywords');
}
}
:インサイド
root:~/workspace $ php artisan migrate:rollback
Rolled back: 2014_10_12_100000_create_password_resets_table
root:~/workspace $ php artisan migrate
[Illuminate\Database\QueryException]
SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'created_at' (SQL: create table `keywords` (`id` int unsigned not null auto_incr
ement primary key, `keyword` varchar(255) not null, `created_at` timestamp null, `updated_at` timestamp null, `created_at` timestamp null, `updated
_at` timestamp null) default character set utf8 collate utf8_unicode_ci)
[PDOException]
SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'created_at'
root:~/workspace $
一つは、箱から出てくると、もう一つは、私の新しく作成された移行2017_02_19_172350_create_keywords_table
ある標準2014_10_12_100000_create_password_resets_table
ですデータベースなしテーブルkeywords
が作成されます。私が間違っているの何
任意の提案ですか?
返信いただきありがとうございます。
** composer dump **コマンドを試してから、** php aristan migration:refresh **を試してみてください – zgabievi