Differential D3002 Diff 8579 src/database/migrations/2021_11_05_100000_create_group_settings_table.php
Changeset View
Changeset View
Standalone View
Standalone View
src/database/migrations/2021_11_05_100000_create_group_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 CreateGroupSettingsTable extends Migration | |||||
{ | |||||
/** | |||||
* Run the migrations. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function up() | |||||
{ | |||||
Schema::create( | |||||
'group_settings', | |||||
function (Blueprint $table) { | |||||
$table->bigIncrements('id'); | |||||
$table->bigInteger('group_id'); | |||||
$table->string('key'); | |||||
$table->text('value'); | |||||
$table->timestamp('created_at')->useCurrent(); | |||||
mollekopf: This is a string in the user_settings table, I assume we need to store larger values here? | |||||
Done Inline ActionsIt was a string initially, but later on changed to text. So, this is consistent, the default 'string' column length is not enough, indeed. machniak: It was a string initially, but later on changed to text. So, this is consistent, the default… | |||||
$table->timestamp('updated_at')->useCurrent(); | |||||
$table->foreign('group_id')->references('id')->on('groups') | |||||
->onDelete('cascade')->onUpdate('cascade'); | |||||
$table->unique(['group_id', 'key']); | |||||
} | |||||
); | |||||
} | |||||
/** | |||||
* Reverse the migrations. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function down() | |||||
{ | |||||
Schema::dropIfExists('group_settings'); | |||||
} | |||||
} |
This is a string in the user_settings table, I assume we need to store larger values here?