【发布时间】:2017-05-03 12:23:32
【问题描述】:
我正在尝试修改现有迁移。这是我当前的迁移课程:
class CreateLogForUserTable extends Migration
{
public function up()
{
Schema::create('log_for_user', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id');
$table->string('table_name');
$table->string('error_message');
$table->unsignedTinyInteger('error_code');
$table->timestamps();
});
}
public function down()
{
Schema::drop('log_for_user');
}
}
我已经执行了一次php artisan migrate 命令。现在我需要将->nullable() 方法添加到error_message 列。所以我编辑了我的迁移,如下所示:
.
.
$table->string('error_message')->nullable();
.
.
但是当我再次执行php artisan migrate 时,它会说:
没有要迁移的东西。
如何应用新版本的迁移?
【问题讨论】: