2020-08-27 17:21:34 +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;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Auto-generated migration step: Please modify to your needs!
|
|
|
|
*/
|
|
|
|
class Version000000Date20200826100844 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) {
|
|
|
|
/** @var ISchemaWrapper $schema */
|
|
|
|
$schema = $schemaClosure();
|
|
|
|
|
|
|
|
if (!$schema->hasTable('bbb_restrictions')) {
|
|
|
|
$table = $schema->createTable('bbb_restrictions');
|
|
|
|
$table->addColumn('id', 'integer', [
|
|
|
|
'autoincrement' => true,
|
2021-07-26 15:44:14 +02:00
|
|
|
'notnull' => true,
|
2020-08-27 17:21:34 +02:00
|
|
|
]);
|
|
|
|
$table->addColumn('group_id', 'string', [
|
|
|
|
'notnull' => true,
|
2021-07-26 15:44:14 +02:00
|
|
|
'length' => 200,
|
2020-08-27 17:21:34 +02:00
|
|
|
]);
|
|
|
|
$table->addColumn('max_rooms', 'integer', [
|
|
|
|
'notnull' => false,
|
|
|
|
'default' => -1,
|
|
|
|
]);
|
|
|
|
$table->addColumn('room_types', 'string', [
|
|
|
|
'notnull' => true,
|
|
|
|
'default' => '[]',
|
|
|
|
]);
|
|
|
|
$table->addColumn('max_participants', 'integer', [
|
|
|
|
'notnull' => false,
|
|
|
|
'default' => -1,
|
|
|
|
]);
|
|
|
|
$table->addColumn('allow_recording', 'boolean', [
|
2021-07-26 15:54:54 +02:00
|
|
|
'notnull' => false,
|
2020-08-27 17:21:34 +02:00
|
|
|
'default' => true,
|
|
|
|
]);
|
|
|
|
|
|
|
|
$table->setPrimaryKey(['id']);
|
|
|
|
$table->addIndex(['group_id'], 'restrictions_group_id_index');
|
|
|
|
}
|
|
|
|
|
|
|
|
return $schema;
|
|
|
|
}
|
|
|
|
}
|