2020-04-26 11:36:41 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace OCA\BigBlueButton\Migration;
|
|
|
|
|
|
|
|
use Closure;
|
|
|
|
use OCP\DB\ISchemaWrapper;
|
|
|
|
use OCP\Migration\IOutput;
|
2020-09-23 12:33:09 +02:00
|
|
|
use OCP\Migration\SimpleMigrationStep;
|
2020-04-26 11:36:41 +02:00
|
|
|
|
2020-06-19 09:28:58 +02:00
|
|
|
class Version000000Date20200416124731 extends SimpleMigrationStep {
|
2020-04-26 11:36:41 +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-04-26 11:36:41 +02:00
|
|
|
/** @var ISchemaWrapper $schema */
|
|
|
|
$schema = $schemaClosure();
|
|
|
|
|
|
|
|
if (!$schema->hasTable('bbb_rooms')) {
|
|
|
|
$table = $schema->createTable('bbb_rooms');
|
|
|
|
$table->addColumn('id', 'integer', [
|
|
|
|
'autoincrement' => true,
|
2021-07-26 15:44:14 +02:00
|
|
|
'notnull' => true,
|
2020-04-26 11:36:41 +02:00
|
|
|
]);
|
|
|
|
$table->addColumn('uid', 'string', [
|
|
|
|
'notnull' => true,
|
2021-07-26 15:44:14 +02:00
|
|
|
'length' => 64
|
2020-04-26 11:36:41 +02:00
|
|
|
]);
|
|
|
|
$table->addColumn('user_id', 'string', [
|
|
|
|
'notnull' => true,
|
2021-07-26 15:44:14 +02:00
|
|
|
'length' => 200,
|
2020-04-26 11:36:41 +02:00
|
|
|
]);
|
|
|
|
$table->addColumn('name', 'string', [
|
|
|
|
'notnull' => true,
|
2021-07-26 15:44:14 +02:00
|
|
|
'length' => 200
|
2020-04-26 11:36:41 +02:00
|
|
|
]);
|
|
|
|
$table->addColumn('attendee_password', 'string', [
|
|
|
|
'notnull' => true,
|
2021-07-26 15:44:14 +02:00
|
|
|
'length' => 32
|
2020-04-26 11:36:41 +02:00
|
|
|
]);
|
|
|
|
$table->addColumn('moderator_password', 'string', [
|
|
|
|
'notnull' => true,
|
2021-07-26 15:44:14 +02:00
|
|
|
'length' => 32
|
2020-04-26 11:36:41 +02:00
|
|
|
]);
|
|
|
|
$table->addColumn('welcome', 'string', [
|
|
|
|
'notnull' => false,
|
|
|
|
]);
|
|
|
|
$table->addColumn('max_participants', 'integer', [
|
|
|
|
'notnull' => false,
|
|
|
|
]);
|
|
|
|
$table->addColumn('record', 'boolean', [
|
2021-07-26 15:54:54 +02:00
|
|
|
'notnull' => false,
|
2020-04-26 11:36:41 +02:00
|
|
|
]);
|
|
|
|
|
|
|
|
$table->setPrimaryKey(['id']);
|
|
|
|
$table->addIndex(['uid'], 'bbb_rooms_uid_index');
|
|
|
|
$table->addIndex(['user_id'], 'bbb_rooms_user_id_index');
|
|
|
|
}
|
|
|
|
return $schema;
|
|
|
|
}
|
|
|
|
}
|