Enabled default routing
This commit is contained in:
36
database/migrations/2021_08_08_125817_default_route.php
Normal file
36
database/migrations/2021_08_08_125817_default_route.php
Normal 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');
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user