gpt4 book ai didi

laravel - 如何在 Laravel 迁移中的特定列之后订购多个新列

转载 作者:行者123 更新时间:2023-12-05 08:22:57 25 4
gpt4 key购买 nike

有什么好的方法吗?我目前通过以我想要的顺序的相反顺序列出列来做到这一点:

Schema::table('some_table', function($table){
$table->string('new_col_2')->after('existing_col'); //How to specify that this should come after new_col_1?
$table->string('new_col_1')->after('existing_col');
});

最佳答案

你试过吗:

Schema::table('some_table', function($table){
$table->string('new_col_1')->after('existing_col');
$table->string('new_col_2')->after('new_col_1');
}

关于laravel - 如何在 Laravel 迁移中的特定列之后订购多个新列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53671239/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com