2020-06-15 17:23:53 +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 Version000000Date20200613111242 extends SimpleMigrationStep {
|
2020-06-15 17:23:53 +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-15 17:23:53 +02:00
|
|
|
/** @var ISchemaWrapper $schema */
|
|
|
|
$schema = $schemaClosure();
|
|
|
|
|
|
|
|
if (!$schema->hasTable('bbb_room_shares')) {
|
|
|
|
$table = $schema->createTable('bbb_room_shares');
|
|
|
|
$table->addColumn('id', 'integer', [
|
|
|
|
'autoincrement' => true,
|
2021-07-26 15:44:14 +02:00
|
|
|
'notnull' => true,
|
2020-06-15 17:23:53 +02:00
|
|
|
]);
|
|
|
|
$table->addColumn('room_id', 'integer', [
|
|
|
|
'notnull' => true,
|
|
|
|
]);
|
|
|
|
$table->addColumn('share_with', 'string', [
|
|
|
|
'notnull' => true,
|
2021-07-26 15:44:14 +02:00
|
|
|
'length' => 200,
|
2020-06-15 17:23:53 +02:00
|
|
|
]);
|
|
|
|
$table->addColumn('share_type', 'integer', [
|
|
|
|
'notnull' => true,
|
|
|
|
]);
|
|
|
|
$table->addColumn('permission', 'integer', [
|
|
|
|
'notnull' => true,
|
|
|
|
]);
|
|
|
|
|
|
|
|
$table->setPrimaryKey(['id']);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $schema;
|
|
|
|
}
|
|
|
|
}
|