Enable default zones for 4d systems

This commit is contained in:
Deon George
2021-08-16 22:26:33 +10:00
parent 111461e515
commit 628293c741
5 changed files with 91 additions and 18 deletions

View 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);
});
}
}