From a1a1cf6f932fe60d4810dd17cd809283cecb988e Mon Sep 17 00:00:00 2001 From: Thomas Rupprecht Date: Wed, 8 Feb 2023 21:53:58 +0100 Subject: [PATCH] Unify migration style and cleanup (#1037) * unify helper methods access type to private * unify codestyle * remove unused down methods --- .../2018_01_01_000003_fix_old_tables.php | 7 -- ...000005_add_angel_supporter_permissions.php | 2 +- ...09_24_000000_create_event_config_table.php | 2 +- ...0_change_users_contact_dect_field_size.php | 2 +- ...12_27_000000_fix_missing_arrival_dates.php | 7 -- ..._07_000001_create_schedule_shift_table.php | 77 +++++++------------ .../2019_10_15_000000_create_news_table.php | 3 +- ...019_11_25_000000_create_messages_table.php | 39 ++++------ ...19_11_29_000000_create_questions_table.php | 38 ++++----- ...0_user_personal_data_add_pronoun_field.php | 5 +- ...nge_mysql_database_encoding_to_utf8mb4.php | 8 +- ...me_minutes_and_timestamps_to_schedules.php | 60 ++++++--------- ...00000_add_email_news_to_users_settings.php | 18 ++--- .../2020_12_25_000000_oauth_add_tokens.php | 26 +++---- .../2020_12_26_000000_news_add_is_pinned.php | 18 ++--- ..._28_000001_oauth_change_tokens_to_text.php | 22 ++---- ...21_10_12_000000_add_shifts_description.php | 18 ++--- ..._000000_users_settings_add_email_goody.php | 18 ++--- ...00000_fix_old_groups_table_id_and_name.php | 2 +- ...0000_add_mobile_show_to_users_settings.php | 18 ++--- .../2022_10_17_000000_add_dect_to_rooms.php | 18 ++--- ...000000_add_hide_register_to_angeltypes.php | 18 ++--- ...e_privileges_and_groups_related_tables.php | 8 +- ...1_06_000000_shifttype_remove_angeltype.php | 25 ++---- 24 files changed, 161 insertions(+), 298 deletions(-) diff --git a/db/migrations/2018_01_01_000003_fix_old_tables.php b/db/migrations/2018_01_01_000003_fix_old_tables.php index 4be701a5..322c67bd 100644 --- a/db/migrations/2018_01_01_000003_fix_old_tables.php +++ b/db/migrations/2018_01_01_000003_fix_old_tables.php @@ -36,11 +36,4 @@ class FixOldTables extends Migration }); } } - - /** - * Reverse the migration - */ - public function down(): void - { - } } diff --git a/db/migrations/2018_01_01_000005_add_angel_supporter_permissions.php b/db/migrations/2018_01_01_000005_add_angel_supporter_permissions.php index 6ec3c7cb..59288ddf 100644 --- a/db/migrations/2018_01_01_000005_add_angel_supporter_permissions.php +++ b/db/migrations/2018_01_01_000005_add_angel_supporter_permissions.php @@ -54,7 +54,7 @@ class AddAngelSupporterPermissions extends Migration ); } - protected function getQuery(string $type): string + private function getQuery(string $type): string { return sprintf(' %s FROM GroupPrivileges diff --git a/db/migrations/2018_09_24_000000_create_event_config_table.php b/db/migrations/2018_09_24_000000_create_event_config_table.php index ef232e0f..a9b9fb2e 100644 --- a/db/migrations/2018_09_24_000000_create_event_config_table.php +++ b/db/migrations/2018_09_24_000000_create_event_config_table.php @@ -114,7 +114,7 @@ class CreateEventConfigTable extends Migration $this->schema->dropIfExists('event_config'); } - protected function getConfigValue(Collection $config, string $name): mixed + private function getConfigValue(Collection $config, string $name): mixed { $value = $config->where('name', $name)->first('value', (object) ['value' => null])->value; diff --git a/db/migrations/2018_12_21_000000_change_users_contact_dect_field_size.php b/db/migrations/2018_12_21_000000_change_users_contact_dect_field_size.php index 282d4dc8..8bf68433 100644 --- a/db/migrations/2018_12_21_000000_change_users_contact_dect_field_size.php +++ b/db/migrations/2018_12_21_000000_change_users_contact_dect_field_size.php @@ -31,7 +31,7 @@ class ChangeUsersContactDectFieldSize extends Migration $this->changeDectTo(5); } - protected function changeDectTo(int $length): void + private function changeDectTo(int $length): void { foreach ($this->tables as $table => $column) { if (!$this->schema->hasTable($table)) { diff --git a/db/migrations/2018_12_27_000000_fix_missing_arrival_dates.php b/db/migrations/2018_12_27_000000_fix_missing_arrival_dates.php index 41bd5ec8..a380de27 100644 --- a/db/migrations/2018_12_27_000000_fix_missing_arrival_dates.php +++ b/db/migrations/2018_12_27_000000_fix_missing_arrival_dates.php @@ -34,11 +34,4 @@ class FixMissingArrivalDates extends Migration ->update((array) $state); } } - - /** - * Down is not possible and not needed since this is a bugfix. - */ - public function down(): void - { - } } diff --git a/db/migrations/2019_09_07_000001_create_schedule_shift_table.php b/db/migrations/2019_09_07_000001_create_schedule_shift_table.php index cd5676a9..cbe839b1 100644 --- a/db/migrations/2019_09_07_000001_create_schedule_shift_table.php +++ b/db/migrations/2019_09_07_000001_create_schedule_shift_table.php @@ -16,47 +16,35 @@ class CreateScheduleShiftTable extends Migration */ public function up(): void { - $this->schema->create( - 'schedules', - function (Blueprint $table): void { - $table->increments('id'); - $table->string('url'); - } - ); + $this->schema->create('schedules', function (Blueprint $table): void { + $table->increments('id'); + $table->string('url'); + }); - $this->schema->create( - 'schedule_shift', - function (Blueprint $table): void { - $table->integer('shift_id')->index()->unique(); - if ($this->schema->hasTable('Shifts')) { - // Legacy table access - $table->foreign('shift_id') - ->references('SID')->on('Shifts') - ->onUpdate('cascade') - ->onDelete('cascade'); - } - - $this->references($table, 'schedules'); - $table->uuid('guid'); + $this->schema->create('schedule_shift', function (Blueprint $table): void { + $table->integer('shift_id')->index()->unique(); + if ($this->schema->hasTable('Shifts')) { + // Legacy table access + $table->foreign('shift_id') + ->references('SID')->on('Shifts') + ->onUpdate('cascade') + ->onDelete('cascade'); } - ); + + $this->references($table, 'schedules'); + $table->uuid('guid'); + }); if ($this->schema->hasTable('Shifts')) { - $this->schema->table( - 'Shifts', - function (Blueprint $table): void { - $table->dropColumn('PSID'); - } - ); + $this->schema->table('Shifts', function (Blueprint $table): void { + $table->dropColumn('PSID'); + }); } if ($this->schema->hasTable('Room')) { - $this->schema->table( - 'Room', - function (Blueprint $table): void { - $table->dropColumn('from_frab'); - } - ); + $this->schema->table('Room', function (Blueprint $table): void { + $table->dropColumn('from_frab'); + }); } } @@ -66,24 +54,15 @@ class CreateScheduleShiftTable extends Migration public function down(): void { if ($this->schema->hasTable('Room')) { - $this->schema->table( - 'Room', - function (Blueprint $table): void { - $table->boolean('from_frab') - ->default(false); - } - ); + $this->schema->table('Room', function (Blueprint $table): void { + $table->boolean('from_frab')->default(false); + }); } if ($this->schema->hasTable('Shifts')) { - $this->schema->table( - 'Shifts', - function (Blueprint $table): void { - $table->integer('PSID') - ->nullable()->default(null) - ->unique(); - } - ); + $this->schema->table('Shifts', function (Blueprint $table): void { + $table->integer('PSID')->nullable()->default(null)->unique(); + }); } $this->schema->drop('schedule_shift'); 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 4cb9bca6..95891afe 100644 --- a/db/migrations/2019_10_15_000000_create_news_table.php +++ b/db/migrations/2019_10_15_000000_create_news_table.php @@ -103,8 +103,7 @@ class CreateNewsTable extends Migration $this->schema->create('News', function (Blueprint $table): void { $table->increments('ID'); $table->integer('Datum'); - $table->string('Betreff', 150) - ->default(''); + $table->string('Betreff', 150)->default(''); $table->text('Text'); $this->references($table, 'users', 'UID'); $table->boolean('Treffen')->default(false); diff --git a/db/migrations/2019_11_25_000000_create_messages_table.php b/db/migrations/2019_11_25_000000_create_messages_table.php index 118e31f6..e48154a8 100644 --- a/db/migrations/2019_11_25_000000_create_messages_table.php +++ b/db/migrations/2019_11_25_000000_create_messages_table.php @@ -66,17 +66,14 @@ class CreateMessagesTable extends Migration private function createNewMessagesTable(): void { - $this->schema->create( - 'messages', - function (Blueprint $table): void { - $table->increments('id'); - $this->referencesUser($table); - $this->references($table, 'users', 'receiver_id'); - $table->boolean('read')->default(0); - $table->text('text'); - $table->timestamps(); - } - ); + $this->schema->create('messages', function (Blueprint $table): void { + $table->increments('id'); + $this->referencesUser($table); + $this->references($table, 'users', 'receiver_id'); + $table->boolean('read')->default(0); + $table->text('text'); + $table->timestamps(); + }); } private function copyPreviousToNewMessagesTable(): void @@ -105,18 +102,14 @@ class CreateMessagesTable extends Migration private function createPreviousMessagesTable(): void { - $this->schema->create( - 'Messages', - function (Blueprint $table): void { - $table->increments('id'); - $table->integer('Datum'); - $this->references($table, 'users', 'SUID'); - $this->references($table, 'users', 'RUID'); - $table->char('isRead') - ->default('N'); - $table->text('Text'); - } - ); + $this->schema->create('Messages', function (Blueprint $table): void { + $table->increments('id'); + $table->integer('Datum'); + $this->references($table, 'users', 'SUID'); + $this->references($table, 'users', 'RUID'); + $table->char('isRead')->default('N'); + $table->text('Text'); + }); } private function copyNewToPreviousMessagesTable(): void 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 6b28ae5b..bfd0d97e 100644 --- a/db/migrations/2019_11_29_000000_create_questions_table.php +++ b/db/migrations/2019_11_29_000000_create_questions_table.php @@ -59,18 +59,13 @@ class CreateQuestionsTable extends Migration private function createNewQuestionsTable(): void { - $this->schema->create( - 'questions', - function (Blueprint $table): void { - $table->increments('id'); - $this->referencesUser($table); - $table->text('text'); - $table->text('answer') - ->nullable(); - $this->references($table, 'users', 'answerer_id') - ->nullable(); - } - ); + $this->schema->create('questions', function (Blueprint $table): void { + $table->increments('id'); + $this->referencesUser($table); + $table->text('text'); + $table->text('answer')->nullable(); + $this->references($table, 'users', 'answerer_id')->nullable(); + }); } private function copyPreviousToNewQuestionsTable(): void @@ -94,18 +89,13 @@ class CreateQuestionsTable extends Migration private function createPreviousQuestionsTable(): void { - $this->schema->create( - 'Questions', - function (Blueprint $table): void { - $table->increments('QID'); - $this->references($table, 'users', 'UID'); - $table->text('Question'); - $this->references($table, 'users', 'AID') - ->nullable(); - $table->text('Answer') - ->nullable(); - } - ); + $this->schema->create('Questions', function (Blueprint $table): void { + $table->increments('QID'); + $this->references($table, 'users', 'UID'); + $table->text('Question'); + $this->references($table, 'users', 'AID')->nullable(); + $table->text('Answer')->nullable(); + }); } private function copyNewToPreviousQuestionsTable(): void diff --git a/db/migrations/2019_12_03_000000_user_personal_data_add_pronoun_field.php b/db/migrations/2019_12_03_000000_user_personal_data_add_pronoun_field.php index 940466ef..bdb88399 100644 --- a/db/migrations/2019_12_03_000000_user_personal_data_add_pronoun_field.php +++ b/db/migrations/2019_12_03_000000_user_personal_data_add_pronoun_field.php @@ -15,10 +15,7 @@ class UserPersonalDataAddPronounField extends Migration public function up(): void { $this->schema->table('users_personal_data', function (Blueprint $table): void { - $table->string('pronoun', 15) - ->nullable() - ->default(null) - ->after('last_name'); + $table->string('pronoun', 15)->nullable()->default(null)->after('last_name'); }); } diff --git a/db/migrations/2020_04_07_000000_change_mysql_database_encoding_to_utf8mb4.php b/db/migrations/2020_04_07_000000_change_mysql_database_encoding_to_utf8mb4.php index 575cab30..d35c00cc 100644 --- a/db/migrations/2020_04_07_000000_change_mysql_database_encoding_to_utf8mb4.php +++ b/db/migrations/2020_04_07_000000_change_mysql_database_encoding_to_utf8mb4.php @@ -28,11 +28,5 @@ class ChangeMysqlDatabaseEncodingToUtf8mb4 extends Migration } } - /** - * Reverse the migration - */ - public function down(): void - { - // As utf8mb4 is a superset of utf8, there is nothing to do here - } + // As utf8mb4 is a superset of utf8, there is nothing to do in the downgrade } diff --git a/db/migrations/2020_11_20_000000_add_name_minutes_and_timestamps_to_schedules.php b/db/migrations/2020_11_20_000000_add_name_minutes_and_timestamps_to_schedules.php index 34bcc5ca..3bd7ae0e 100644 --- a/db/migrations/2020_11_20_000000_add_name_minutes_and_timestamps_to_schedules.php +++ b/db/migrations/2020_11_20_000000_add_name_minutes_and_timestamps_to_schedules.php @@ -19,16 +19,13 @@ class AddNameMinutesAndTimestampsToSchedules extends Migration { $connection = $this->schema->getConnection(); - $this->schema->table( - 'schedules', - function (Blueprint $table): void { - $table->string('name')->default('')->after('id'); - $table->integer('shift_type')->default(0)->after('name'); - $table->integer('minutes_before')->default(0)->after('shift_type'); - $table->integer('minutes_after')->default(0)->after('minutes_before'); - $table->timestamps(); - } - ); + $this->schema->table('schedules', function (Blueprint $table): void { + $table->string('name')->default('')->after('id'); + $table->integer('shift_type')->default(0)->after('name'); + $table->integer('minutes_before')->default(0)->after('shift_type'); + $table->integer('minutes_after')->default(0)->after('minutes_before'); + $table->timestamps(); + }); $connection->table('schedules') ->update([ @@ -37,15 +34,12 @@ class AddNameMinutesAndTimestampsToSchedules extends Migration 'minutes_after' => 15, ]); - $this->schema->table( - 'schedules', - function (Blueprint $table): void { - $table->string('name')->default(null)->change(); - $table->integer('shift_type')->default(null)->change(); - $table->integer('minutes_before')->default(null)->change(); - $table->integer('minutes_after')->default(null)->change(); - } - ); + $this->schema->table('schedules', function (Blueprint $table): void { + $table->string('name')->default(null)->change(); + $table->integer('shift_type')->default(null)->change(); + $table->integer('minutes_before')->default(null)->change(); + $table->integer('minutes_after')->default(null)->change(); + }); // Add legacy reference if ($this->schema->hasTable('ShiftTypes')) { @@ -61,12 +55,9 @@ class AddNameMinutesAndTimestampsToSchedules extends Migration 'shift_type' => $connection->raw('(' . $query->toSql() . ')') ]); - $this->schema->table( - 'schedules', - function (Blueprint $table): void { - $this->addReference($table, 'shift_type', 'ShiftTypes'); - } - ); + $this->schema->table('schedules', function (Blueprint $table): void { + $this->addReference($table, 'shift_type', 'ShiftTypes'); + }); } } @@ -75,16 +66,13 @@ class AddNameMinutesAndTimestampsToSchedules extends Migration */ public function down(): void { - $this->schema->table( - 'schedules', - function (Blueprint $table): void { - $table->dropForeign('schedules_shift_type_foreign'); - $table->dropColumn('name'); - $table->dropColumn('shift_type'); - $table->dropColumn('minutes_before'); - $table->dropColumn('minutes_after'); - $table->dropTimestamps(); - } - ); + $this->schema->table('schedules', function (Blueprint $table): void { + $table->dropForeign('schedules_shift_type_foreign'); + $table->dropColumn('name'); + $table->dropColumn('shift_type'); + $table->dropColumn('minutes_before'); + $table->dropColumn('minutes_after'); + $table->dropTimestamps(); + }); } } diff --git a/db/migrations/2020_12_25_000000_add_email_news_to_users_settings.php b/db/migrations/2020_12_25_000000_add_email_news_to_users_settings.php index c80c0d6e..d7e17b83 100644 --- a/db/migrations/2020_12_25_000000_add_email_news_to_users_settings.php +++ b/db/migrations/2020_12_25_000000_add_email_news_to_users_settings.php @@ -16,12 +16,9 @@ class AddEmailNewsToUsersSettings extends Migration */ public function up(): void { - $this->schema->table( - 'users_settings', - function (Blueprint $table): void { - $table->boolean('email_news')->default(false)->after('email_shiftinfo'); - } - ); + $this->schema->table('users_settings', function (Blueprint $table): void { + $table->boolean('email_news')->default(false)->after('email_shiftinfo'); + }); } /** @@ -29,11 +26,8 @@ class AddEmailNewsToUsersSettings extends Migration */ public function down(): void { - $this->schema->table( - 'users_settings', - function (Blueprint $table): void { - $table->dropColumn('email_news'); - } - ); + $this->schema->table('users_settings', function (Blueprint $table): void { + $table->dropColumn('email_news'); + }); } } diff --git a/db/migrations/2020_12_25_000000_oauth_add_tokens.php b/db/migrations/2020_12_25_000000_oauth_add_tokens.php index 47a03aaa..1c02d8cd 100644 --- a/db/migrations/2020_12_25_000000_oauth_add_tokens.php +++ b/db/migrations/2020_12_25_000000_oauth_add_tokens.php @@ -16,14 +16,11 @@ class OauthAddTokens extends Migration */ public function up(): void { - $this->schema->table( - 'oauth', - function (Blueprint $table): void { - $table->string('access_token')->nullable()->default(null)->after('identifier'); - $table->string('refresh_token')->nullable()->default(null)->after('access_token'); - $table->dateTime('expires_at')->nullable()->default(null)->after('refresh_token'); - } - ); + $this->schema->table('oauth', function (Blueprint $table): void { + $table->string('access_token')->nullable()->default(null)->after('identifier'); + $table->string('refresh_token')->nullable()->default(null)->after('access_token'); + $table->dateTime('expires_at')->nullable()->default(null)->after('refresh_token'); + }); } /** @@ -31,13 +28,10 @@ class OauthAddTokens extends Migration */ public function down(): void { - $this->schema->table( - 'oauth', - function (Blueprint $table): void { - $table->dropColumn('access_token'); - $table->dropColumn('refresh_token'); - $table->dropColumn('expires_at'); - } - ); + $this->schema->table('oauth', function (Blueprint $table): void { + $table->dropColumn('access_token'); + $table->dropColumn('refresh_token'); + $table->dropColumn('expires_at'); + }); } } diff --git a/db/migrations/2020_12_26_000000_news_add_is_pinned.php b/db/migrations/2020_12_26_000000_news_add_is_pinned.php index 3b6ffcf8..e60e5a5e 100644 --- a/db/migrations/2020_12_26_000000_news_add_is_pinned.php +++ b/db/migrations/2020_12_26_000000_news_add_is_pinned.php @@ -16,12 +16,9 @@ class NewsAddIsPinned extends Migration */ public function up(): void { - $this->schema->table( - 'news', - function (Blueprint $table): void { - $table->boolean('is_pinned')->default(false)->after('is_meeting'); - } - ); + $this->schema->table('news', function (Blueprint $table): void { + $table->boolean('is_pinned')->default(false)->after('is_meeting'); + }); } /** @@ -29,11 +26,8 @@ class NewsAddIsPinned extends Migration */ public function down(): void { - $this->schema->table( - 'news', - function (Blueprint $table): void { - $table->dropColumn('is_pinned'); - } - ); + $this->schema->table('news', function (Blueprint $table): void { + $table->dropColumn('is_pinned'); + }); } } diff --git a/db/migrations/2020_12_28_000001_oauth_change_tokens_to_text.php b/db/migrations/2020_12_28_000001_oauth_change_tokens_to_text.php index be793908..685322c8 100644 --- a/db/migrations/2020_12_28_000001_oauth_change_tokens_to_text.php +++ b/db/migrations/2020_12_28_000001_oauth_change_tokens_to_text.php @@ -16,13 +16,10 @@ class OauthChangeTokensToText extends Migration */ public function up(): void { - $this->schema->table( - 'oauth', - function (Blueprint $table): void { - $table->text('access_token')->change(); - $table->text('refresh_token')->change(); - } - ); + $this->schema->table('oauth', function (Blueprint $table): void { + $table->text('access_token')->change(); + $table->text('refresh_token')->change(); + }); } /** @@ -30,12 +27,9 @@ class OauthChangeTokensToText extends Migration */ public function down(): void { - $this->schema->table( - 'oauth', - function (Blueprint $table): void { - $table->string('access_token')->change(); - $table->string('refresh_token')->change(); - } - ); + $this->schema->table('oauth', function (Blueprint $table): void { + $table->string('access_token')->change(); + $table->string('refresh_token')->change(); + }); } } diff --git a/db/migrations/2021_10_12_000000_add_shifts_description.php b/db/migrations/2021_10_12_000000_add_shifts_description.php index 13a3b4b8..47ad04dd 100644 --- a/db/migrations/2021_10_12_000000_add_shifts_description.php +++ b/db/migrations/2021_10_12_000000_add_shifts_description.php @@ -20,12 +20,9 @@ class AddShiftsDescription extends Migration return; } - $this->schema->table( - 'Shifts', - function (Blueprint $table): void { - $table->text('description')->nullable()->after('shifttype_id'); - } - ); + $this->schema->table('Shifts', function (Blueprint $table): void { + $table->text('description')->nullable()->after('shifttype_id'); + }); } /** @@ -37,11 +34,8 @@ class AddShiftsDescription extends Migration return; } - $this->schema->table( - 'Shifts', - function (Blueprint $table): void { - $table->dropColumn('description'); - } - ); + $this->schema->table('Shifts', function (Blueprint $table): void { + $table->dropColumn('description'); + }); } } diff --git a/db/migrations/2021_12_29_000000_users_settings_add_email_goody.php b/db/migrations/2021_12_29_000000_users_settings_add_email_goody.php index 956e0bc7..643bab03 100644 --- a/db/migrations/2021_12_29_000000_users_settings_add_email_goody.php +++ b/db/migrations/2021_12_29_000000_users_settings_add_email_goody.php @@ -18,12 +18,9 @@ class UsersSettingsAddEmailGoody extends Migration { $connection = $this->schema->getConnection(); - $this->schema->table( - 'users_settings', - function (Blueprint $table): void { - $table->boolean('email_goody')->default(false)->after('email_human'); - } - ); + $this->schema->table('users_settings', function (Blueprint $table): void { + $table->boolean('email_goody')->default(false)->after('email_human'); + }); $connection ->table('users_settings') @@ -35,11 +32,8 @@ class UsersSettingsAddEmailGoody extends Migration */ public function down(): void { - $this->schema->table( - 'users_settings', - function (Blueprint $table): void { - $table->dropColumn('email_goody'); - } - ); + $this->schema->table('users_settings', function (Blueprint $table): void { + $table->dropColumn('email_goody'); + }); } } diff --git a/db/migrations/2022_07_21_000000_fix_old_groups_table_id_and_name.php b/db/migrations/2022_07_21_000000_fix_old_groups_table_id_and_name.php index 438c8c8e..f12158ce 100644 --- a/db/migrations/2022_07_21_000000_fix_old_groups_table_id_and_name.php +++ b/db/migrations/2022_07_21_000000_fix_old_groups_table_id_and_name.php @@ -51,7 +51,7 @@ class FixOldGroupsTableIdAndName extends Migration * @param string[] $naming * @param int[] $ids */ - protected function migrate(array $naming, array $ids): void + private function migrate(array $naming, array $ids): void { if (!$this->schema->hasTable('Groups')) { return; diff --git a/db/migrations/2022_10_16_000000_add_mobile_show_to_users_settings.php b/db/migrations/2022_10_16_000000_add_mobile_show_to_users_settings.php index d51baa44..ad08440f 100644 --- a/db/migrations/2022_10_16_000000_add_mobile_show_to_users_settings.php +++ b/db/migrations/2022_10_16_000000_add_mobile_show_to_users_settings.php @@ -14,12 +14,9 @@ class AddMobileShowToUsersSettings extends Migration */ public function up(): void { - $this->schema->table( - 'users_settings', - function (Blueprint $table): void { - $table->boolean('mobile_show')->default(false)->after('email_news'); - } - ); + $this->schema->table('users_settings', function (Blueprint $table): void { + $table->boolean('mobile_show')->default(false)->after('email_news'); + }); } /** @@ -27,11 +24,8 @@ class AddMobileShowToUsersSettings extends Migration */ public function down(): void { - $this->schema->table( - 'users_settings', - function (Blueprint $table): void { - $table->dropColumn('mobile_show'); - } - ); + $this->schema->table('users_settings', function (Blueprint $table): void { + $table->dropColumn('mobile_show'); + }); } } diff --git a/db/migrations/2022_10_17_000000_add_dect_to_rooms.php b/db/migrations/2022_10_17_000000_add_dect_to_rooms.php index 23e8a1c1..5b8abcea 100644 --- a/db/migrations/2022_10_17_000000_add_dect_to_rooms.php +++ b/db/migrations/2022_10_17_000000_add_dect_to_rooms.php @@ -14,12 +14,9 @@ class AddDectToRooms extends Migration */ public function up(): void { - $this->schema->table( - 'rooms', - function (Blueprint $table): void { - $table->text('dect')->nullable()->after('description'); - } - ); + $this->schema->table('rooms', function (Blueprint $table): void { + $table->text('dect')->nullable()->after('description'); + }); } /** @@ -27,11 +24,8 @@ class AddDectToRooms extends Migration */ public function down(): void { - $this->schema->table( - 'rooms', - function (Blueprint $table): void { - $table->dropColumn('dect'); - } - ); + $this->schema->table('rooms', function (Blueprint $table): void { + $table->dropColumn('dect'); + }); } } diff --git a/db/migrations/2022_10_21_000000_add_hide_register_to_angeltypes.php b/db/migrations/2022_10_21_000000_add_hide_register_to_angeltypes.php index 2d878605..a70817dc 100644 --- a/db/migrations/2022_10_21_000000_add_hide_register_to_angeltypes.php +++ b/db/migrations/2022_10_21_000000_add_hide_register_to_angeltypes.php @@ -18,12 +18,9 @@ class AddHideRegisterToAngeltypes extends Migration return; } - $this->schema->table( - 'AngelTypes', - function (Blueprint $table): void { - $table->boolean('hide_register')->default(false)->after('show_on_dashboard'); - } - ); + $this->schema->table('AngelTypes', function (Blueprint $table): void { + $table->boolean('hide_register')->default(false)->after('show_on_dashboard'); + }); } /** @@ -35,11 +32,8 @@ class AddHideRegisterToAngeltypes extends Migration return; } - $this->schema->table( - 'AngelTypes', - function (Blueprint $table): void { - $table->dropColumn('hide_register'); - } - ); + $this->schema->table('AngelTypes', function (Blueprint $table): void { + $table->dropColumn('hide_register'); + }); } } diff --git a/db/migrations/2022_10_23_000000_create_privileges_and_groups_related_tables.php b/db/migrations/2022_10_23_000000_create_privileges_and_groups_related_tables.php index 07f6997b..3c6b0ad8 100644 --- a/db/migrations/2022_10_23_000000_create_privileges_and_groups_related_tables.php +++ b/db/migrations/2022_10_23_000000_create_privileges_and_groups_related_tables.php @@ -108,7 +108,7 @@ class CreatePrivilegesAndGroupsRelatedTables extends Migration $this->schema->drop('privileges_new'); } - protected function createNew(): void + private function createNew(): void { $this->schema->create('groups', function (Blueprint $table): void { $table->increments('id'); @@ -134,7 +134,7 @@ class CreatePrivilegesAndGroupsRelatedTables extends Migration }); } - protected function createOldTable(): void + private function createOldTable(): void { $this->schema->create('Groups', function (Blueprint $table): void { $table->string('Name', 35); @@ -162,7 +162,7 @@ class CreatePrivilegesAndGroupsRelatedTables extends Migration }); } - protected function copyOldToNew(): void + private function copyOldToNew(): void { $connection = $this->schema->getConnection(); @@ -211,7 +211,7 @@ class CreatePrivilegesAndGroupsRelatedTables extends Migration } } - protected function copyNewToOld(): void + private function copyNewToOld(): void { $connection = $this->schema->getConnection(); diff --git a/db/migrations/2022_11_06_000000_shifttype_remove_angeltype.php b/db/migrations/2022_11_06_000000_shifttype_remove_angeltype.php index 94a4c104..92c25d09 100644 --- a/db/migrations/2022_11_06_000000_shifttype_remove_angeltype.php +++ b/db/migrations/2022_11_06_000000_shifttype_remove_angeltype.php @@ -20,13 +20,10 @@ class ShifttypeRemoveAngeltype extends Migration return; } - $this->schema->table( - 'ShiftTypes', - function (Blueprint $table): void { - $table->dropForeign('shifttypes_ibfk_1'); - $table->dropColumn('angeltype_id'); - } - ); + $this->schema->table('ShiftTypes', function (Blueprint $table): void { + $table->dropForeign('shifttypes_ibfk_1'); + $table->dropColumn('angeltype_id'); + }); } /** @@ -38,15 +35,9 @@ class ShifttypeRemoveAngeltype extends Migration return; } - $this->schema->table( - 'ShiftTypes', - function (Blueprint $table): void { - $table->integer('angeltype_id') - ->after('name') - ->index() - ->nullable(); - $this->addReference($table, 'angeltype_id', 'AngelTypes', null, 'shifttypes_ibfk_1'); - } - ); + $this->schema->table('ShiftTypes', function (Blueprint $table): void { + $table->integer('angeltype_id')->after('name')->index()->nullable(); + $this->addReference($table, 'angeltype_id', 'AngelTypes', null, 'shifttypes_ibfk_1'); + }); } }