2020-06-17 08:19:54 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace OCA\BigBlueButton\Migration;
|
|
|
|
|
|
|
|
use Closure;
|
|
|
|
use OCP\DB\ISchemaWrapper;
|
|
|
|
use OCP\Migration\IOutput;
|
|
|
|
use OCP\Migration\SimpleMigrationStep;
|
|
|
|
|
2020-06-19 09:28:58 +02:00
|
|
|
class Version000000Date20200617055735 extends SimpleMigrationStep {
|
2020-06-17 08:19:54 +02:00
|
|
|
/**
|
|
|
|
* @param IOutput $output
|
|
|
|
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
|
|
|
|
* @param array $options
|
|
|
|
* @return null|ISchemaWrapper
|
|
|
|
*/
|
2020-06-19 09:28:58 +02:00
|
|
|
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
|
2020-06-17 08:19:54 +02:00
|
|
|
/** @var ISchemaWrapper $schema */
|
|
|
|
$schema = $schemaClosure();
|
|
|
|
|
|
|
|
if ($schema->hasTable('bbb_rooms')) {
|
|
|
|
$table = $schema->getTable('bbb_rooms');
|
|
|
|
|
|
|
|
if (!$table->hasColumn('everyone_is_moderator')) {
|
|
|
|
$table->addColumn('everyone_is_moderator', 'boolean', [
|
2021-07-26 15:54:54 +02:00
|
|
|
'notnull' => false,
|
2020-06-17 08:19:54 +02:00
|
|
|
'default' => false,
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $schema;
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|