From 8218f97e063161acf3f54194c4258b582825c5f1 Mon Sep 17 00:00:00 2001 From: "Specht, David" Date: Thu, 17 Mar 2022 12:55:47 +0100 Subject: [PATCH] fix:merged two migrations into one --- .../Version000000Date20220316125900.php | 42 ------------------- .../Version000000Date20220316165602.php | 34 +++++++++------ 2 files changed, 22 insertions(+), 54 deletions(-) delete mode 100644 lib/Migration/Version000000Date20220316125900.php diff --git a/lib/Migration/Version000000Date20220316125900.php b/lib/Migration/Version000000Date20220316125900.php deleted file mode 100644 index 67db570..0000000 --- a/lib/Migration/Version000000Date20220316125900.php +++ /dev/null @@ -1,42 +0,0 @@ -hasTable('bbb_rooms')) { - $table = $schema->getTable('bbb_rooms'); - - if (!$table->hasColumn('logout_u_r_l')) { - $table->addColumn('logout_u_r_l', 'string', [ - 'notnull' => false, - 'length' => 200 - ]); - } - - return $schema; - } - - return null; - } -} diff --git a/lib/Migration/Version000000Date20220316165602.php b/lib/Migration/Version000000Date20220316165602.php index 516d6cc..3605788 100644 --- a/lib/Migration/Version000000Date20220316165602.php +++ b/lib/Migration/Version000000Date20220316165602.php @@ -23,19 +23,29 @@ class Version000000Date20220316165602 extends SimpleMigrationStep { public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { $schema = $schemaClosure(); - if ($schema->hasTable('bbb_restrictions')) { - $table = $schema->getTable('bbb_restrictions'); - - if (!$table->hasColumn('allow_logout_u_r_l')) { - $table->addColumn('allow_logout_u_r_l', 'boolean', [ - 'notnull' => false, - 'default' => false - ]); - } - - return $schema; + if (!$schema->hasTable('bbb_restrictions') && !$schema->hasTable('bbb_rooms')) { + return null; } - return null; + $table = $schema->getTable('bbb_restrictions'); + + if (!$table->hasColumn('allow_logout_u_r_l')) { + $table->addColumn('allow_logout_u_r_l', 'boolean', [ + 'notnull' => false, + 'default' => false + ]); + } + + $table = $schema->getTable('bbb_rooms'); + + if (!$table->hasColumn('logout_u_r_l')) { + $table->addColumn('logout_u_r_l', 'string', [ + 'notnull' => false, + 'length' => 200 + ]); + } + + return $schema; + } }