Differential D1870 Diff 5191 src/database/migrations/2020_11_20_130000_create_domain_settings_table.php
Changeset View
Changeset View
Standalone View
Standalone View
src/database/migrations/2020_11_20_130000_create_domain_settings_table.php
- This file was added.
<?php | |||||
use Illuminate\Support\Facades\Schema; | |||||
use Illuminate\Database\Schema\Blueprint; | |||||
use Illuminate\Database\Migrations\Migration; | |||||
// phpcs:ignore | |||||
class CreateDomainSettingsTable extends Migration | |||||
{ | |||||
/** | |||||
* Run the migrations. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function up() | |||||
{ | |||||
Schema::create( | |||||
'domain_settings', | |||||
function (Blueprint $table) { | |||||
$table->bigIncrements('id'); | |||||
$table->bigInteger('domain_id'); | |||||
$table->string('key'); | |||||
$table->text('value'); | |||||
$table->timestamp('created_at')->useCurrent(); | |||||
$table->timestamp('updated_at')->useCurrent(); | |||||
$table->foreign('domain_id')->references('id')->on('domains') | |||||
->onDelete('cascade')->onUpdate('cascade'); | |||||
$table->unique(['domain_id', 'key']); | |||||
} | |||||
); | |||||
} | |||||
/** | |||||
* Reverse the migrations. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function down() | |||||
{ | |||||
Schema::dropIfExists('domain_settings'); | |||||
} | |||||
} |