Enabled default routing

This commit is contained in:
Deon George
2021-08-09 23:35:22 +10:00
parent 7ec01d778a
commit c7388c2db6
8 changed files with 154 additions and 35 deletions

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class DefaultRoute extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('system_zone', function (Blueprint $table) {
$table->boolean('default')->nullable();
});
DB::statement('CREATE UNIQUE INDEX default_zone ON system_zone (zone_id) WHERE "default" = true');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
DB::statement("DROP UNIQUE INDEX default_zone");
Schema::table('system_zone', function (Blueprint $table) {
$table->dropColumn('default');
});
}
}