fix:merged two migrations into one

pull/202/head
Specht, David 2022-03-17 12:55:47 +01:00
parent 1917bf116f
commit 8218f97e06
2 changed files with 22 additions and 54 deletions

View File

@ -1,42 +0,0 @@
<?php
declare(strict_types=1);
namespace OCA\BigBlueButton\Migration;
use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
/**
* Auto-generated migration step: Please modify to your needs!
*/
class Version000000Date20220316125900 extends SimpleMigrationStep {
/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
* @param array $options
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
$schema = $schemaClosure();
if ($schema->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;
}
}

View File

@ -23,7 +23,10 @@ class Version000000Date20220316165602 extends SimpleMigrationStep {
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
$schema = $schemaClosure(); $schema = $schemaClosure();
if ($schema->hasTable('bbb_restrictions')) { if (!$schema->hasTable('bbb_restrictions') && !$schema->hasTable('bbb_rooms')) {
return null;
}
$table = $schema->getTable('bbb_restrictions'); $table = $schema->getTable('bbb_restrictions');
if (!$table->hasColumn('allow_logout_u_r_l')) { if (!$table->hasColumn('allow_logout_u_r_l')) {
@ -33,9 +36,16 @@ class Version000000Date20220316165602 extends SimpleMigrationStep {
]); ]);
} }
return $schema; $table = $schema->getTable('bbb_rooms');
if (!$table->hasColumn('logout_u_r_l')) {
$table->addColumn('logout_u_r_l', 'string', [
'notnull' => false,
'length' => 200
]);
} }
return null; return $schema;
} }
} }