新しいマイグレーションファイルを作成しただけで、既存のテーブルに新しいカラムを挿入できます。laravel 5新しく作成したミラーファイルを実行すると、マイグレーションエラーが発生する
ファイルのコードは次のとおりです。
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddStatusToPhoto extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('photos', function(Blueprint $table)
{
$table->integer('status');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
が、私はPHPの職人の移行を実行すると、エラーメッセージがあります:問題が何であるかを
[Illuminate\Database\QueryException]
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'permission_
role' already exists (SQL: create table `permission_role` (`id` int unsigne
d not null auto_increment primary key, `permission_id` int unsigned not nul
l, `role_id` int unsigned not null, `created_at` timestamp default 0 not nu
ll, `updated_at` timestamp default 0 not null) default character set utf8 c
ollate utf8_unicode_ci)
誰を知っていますか?
あなたの移行にこのコード行を入れ、 'ダウン()'内部の追加ドロップテーブルに持っていますか? –
私はpermission_roleテーブルがロールバックされていないことに気付きました.Aldoを手動で削除すると、同じエラーがまだ残っています。 –