这就是我想要做的
if (!Schema::hasColumn('account_settings', 'minimum_onsite_length')) {
Schema::table('account_settings', function (Blueprint $table) {
$table->unsignedInteger('minimum_onsite_length')
->default(180)
->nullable()
->comment('This is comments')
;
});
}
但是评论没有显示在迁移中,我在这里遗漏了什么吗?
我也看过这个问题,但它不起作用 here
最佳答案
你可以这样试试,
if (!Schema::hasColumn('account_settings', 'minimum_onsite_length')) {
Schema::table('account_settings', function (Blueprint $table) {
$table->unsignedInteger('minimum_onsite_length')
->default(180)
->nullable()
->comment('This is comment');
});
}
关于php - 如何使用 Laravel Migrations 在 Mysql 列中添加注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49256069/