billing_plans
table contains a default_plan
column. Only one can be chosen as default. But you can edit plans in table. I want to make a binary column, 1 value equals default, 0 is not. But mysql and laravel consider that 0 value is unique too. Is it possible to make only specific value of column unique?
Migration
Schema::create('billing_plans', function (Blueprint $table) {
$table->increments('id');
$table->integer('price');
$table->boolean('default_plan')->unique()->nullable();
$table->string('name');
$table->timestamps();
}