我正在这样做:
创建:
php artisan make:migration add_total_invoice --table=invoices
代码:
public function up()
{
Schema::table('invoices',function (Blueprint $table) {
$table->double('total')->after('type');
});
}
public function down()
{
Schema::table('invoices',function (Blueprint $table) {
$table->dropColumn('total');
});
}
php artisan migrate
迁移运行没有问题,但是我要检查表并且没有添加列,如果我创建一个新的迁移并将总计放入新列,它说该列已经存在,是什么错误发生?