From 72123fcd31b612e35e5967c01faae9dd202756d8 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sun, 8 Dec 2019 02:09:52 +0100 Subject: Migration References->referencesUser: Changes $setPrimary from true to false --- db/migrations/2018_10_01_000000_create_users_tables.php | 10 +++++----- db/migrations/2019_10_15_000000_create_news_table.php | 2 +- db/migrations/2019_11_12_000000_create_news_comments_table.php | 2 +- db/migrations/2019_11_29_000000_create_questions_table.php | 2 +- db/migrations/Reference.php | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/db/migrations/2018_10_01_000000_create_users_tables.php b/db/migrations/2018_10_01_000000_create_users_tables.php index 40721286..c7937bed 100644 --- a/db/migrations/2018_10_01_000000_create_users_tables.php +++ b/db/migrations/2018_10_01_000000_create_users_tables.php @@ -36,7 +36,7 @@ class CreateUsersTables extends Migration }); $this->schema->create('users_personal_data', function (Blueprint $table) { - $this->referencesUser($table); + $this->referencesUser($table, true); $table->string('first_name', 64)->nullable(); $table->string('last_name', 64)->nullable(); @@ -47,7 +47,7 @@ class CreateUsersTables extends Migration }); $this->schema->create('users_contact', function (Blueprint $table) { - $this->referencesUser($table); + $this->referencesUser($table, true); $table->string('dect', 5)->nullable(); $table->string('mobile', 40)->nullable(); @@ -55,7 +55,7 @@ class CreateUsersTables extends Migration }); $this->schema->create('users_settings', function (Blueprint $table) { - $this->referencesUser($table); + $this->referencesUser($table, true); $table->string('language', 64); $table->tinyInteger('theme'); @@ -64,7 +64,7 @@ class CreateUsersTables extends Migration }); $this->schema->create('users_state', function (Blueprint $table) { - $this->referencesUser($table); + $this->referencesUser($table, true); $table->boolean('arrived')->default(false); $table->dateTime('arrival_date')->nullable(); @@ -75,7 +75,7 @@ class CreateUsersTables extends Migration }); $this->schema->create('password_resets', function (Blueprint $table) { - $this->referencesUser($table); + $this->referencesUser($table, true); $table->text('token'); diff --git a/db/migrations/2019_10_15_000000_create_news_table.php b/db/migrations/2019_10_15_000000_create_news_table.php index 540348cd..e4c48db0 100644 --- a/db/migrations/2019_10_15_000000_create_news_table.php +++ b/db/migrations/2019_10_15_000000_create_news_table.php @@ -76,7 +76,7 @@ class CreateNewsTable extends Migration $table->string('title', 150); $table->text('text'); $table->boolean('is_meeting')->default(0); - $this->referencesUser($table, false); + $this->referencesUser($table); $table->timestamps(); }); } diff --git a/db/migrations/2019_11_12_000000_create_news_comments_table.php b/db/migrations/2019_11_12_000000_create_news_comments_table.php index 00cf99b2..ac080c38 100644 --- a/db/migrations/2019_11_12_000000_create_news_comments_table.php +++ b/db/migrations/2019_11_12_000000_create_news_comments_table.php @@ -64,7 +64,7 @@ class CreateNewsCommentsTable extends Migration $table->increments('id'); $this->references($table, 'news', 'news_id'); $table->text('text'); - $this->referencesUser($table, false); + $this->referencesUser($table); $table->timestamps(); }); } diff --git a/db/migrations/2019_11_29_000000_create_questions_table.php b/db/migrations/2019_11_29_000000_create_questions_table.php index 7ea1ff07..d0674931 100644 --- a/db/migrations/2019_11_29_000000_create_questions_table.php +++ b/db/migrations/2019_11_29_000000_create_questions_table.php @@ -74,7 +74,7 @@ class CreateQuestionsTable extends Migration 'questions', function (Blueprint $table) { $table->increments('id'); - $this->referencesUser($table, false); + $this->referencesUser($table); $table->text('text'); $table->text('answer') ->nullable(); diff --git a/db/migrations/Reference.php b/db/migrations/Reference.php index 90211bc1..49a1f9ea 100644 --- a/db/migrations/Reference.php +++ b/db/migrations/Reference.php @@ -11,7 +11,7 @@ trait Reference * @param Blueprint $table * @param bool $setPrimary */ - protected function referencesUser(Blueprint $table, $setPrimary = true) + protected function referencesUser(Blueprint $table, $setPrimary = false) { $this->references($table, 'users', 'user_id', $setPrimary); } -- cgit v1.2.3