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