移除字段
2018-02-24 15:52 更新
要移除字段,可在结构生成器内使用 dropColumn 方法,请确认在移除前 composer.json 文件内已经加入 doctrine/dbal。
移除数据表字段
Schema::table('users', function($table)
{
$table->dropColumn('votes');
});
移除数据表多个字段
Schema::table('users', function($table)
{
$table->dropColumn(['votes', 'avatar', 'location']);
}); 以上内容是否对您有帮助:
← 修改字段名称

免费 AI IDE


更多建议: