我的迁移看起来像这样,但是似乎什么也没做,甚至没有引发任何错误:
public function up()
{
Schema::table('my_table', function (Blueprint $table) {
$table->unsignedInteger('id')
->first()
->change();
});
}
我知道您可以在创建 列时做到这一点,例如:
$table->unsignedInteger('id')
->first();
使用原始的MySQL语句绝对有可能,但是Laravel迁移可能根本不支持在创建列后移动列?
FYI,使用PHP 7.1,Laravel 5.7和MariaDB / MySQL 5.5