Enable default zones for 4d systems
This commit is contained in:
42
database/migrations/2021_08_15_134329_default_zones.php
Normal file
42
database/migrations/2021_08_15_134329_default_zones.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class DefaultZones extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('domains', function (Blueprint $table) {
|
||||
$table->dropColumn('default');
|
||||
});
|
||||
|
||||
Schema::table('zones', function (Blueprint $table) {
|
||||
$table->boolean('default')->default(FALSE);
|
||||
$table->unique(['zone_id','default']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('zones', function (Blueprint $table) {
|
||||
$table->dropUnique(['zone_id','default']);
|
||||
$table->dropColumn('default');
|
||||
});
|
||||
|
||||
Schema::table('zones', function (Blueprint $table) {
|
||||
$table->boolean('default')->default(FALSE);
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user