43 lines
895 B
PHP
43 lines
895 B
PHP
|
<?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);
|
||
|
});
|
||
|
}
|
||
|
}
|