这里字段 “当期逾期费 fine” 字段默认 null ,和用 默认为 0 的区别大吗
一般数字的字段是不是应该默认值为 0 好一些呢?
Schema::create('installment_items', function (Blueprint $table) {
$table->decimal('fine')->nullable()->comment('当期逾期费');
});
换成 ↓ 默认值为 0
Schema::create('installment_items', function (Blueprint $table) {
$table->decimal('fine')->default(0)->comment('当期逾期费');
});
推荐文章: