cloud_bbb/lib/Migration/Version000000Date2020041612...

66 lines
1.6 KiB
PHP
Raw Normal View History

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
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
*/
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,
'notnull' => true,
2020-04-26 11:36:41 +02:00
]);
$table->addColumn('uid', 'string', [
'notnull' => true,
'length' => 64
2020-04-26 11:36:41 +02:00
]);
$table->addColumn('user_id', 'string', [
'notnull' => true,
'length' => 200,
2020-04-26 11:36:41 +02:00
]);
$table->addColumn('name', 'string', [
'notnull' => true,
'length' => 200
2020-04-26 11:36:41 +02:00
]);
$table->addColumn('attendee_password', 'string', [
'notnull' => true,
'length' => 32
2020-04-26 11:36:41 +02:00
]);
$table->addColumn('moderator_password', 'string', [
'notnull' => true,
'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', [
'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;
}
}