@@ -30,34 +30,34 @@ |
||
| 30 | 30 | use OCP\Migration\IOutput; |
| 31 | 31 | |
| 32 | 32 | class Version23000Date20210721100600 extends SimpleMigrationStep { |
| 33 | - /** |
|
| 34 | - * @param IOutput $output |
|
| 35 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
| 36 | - * @param array $options |
|
| 37 | - * @return null|ISchemaWrapper |
|
| 38 | - */ |
|
| 39 | - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
| 40 | - /** @var ISchemaWrapper $schema */ |
|
| 41 | - $schema = $schemaClosure(); |
|
| 33 | + /** |
|
| 34 | + * @param IOutput $output |
|
| 35 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
| 36 | + * @param array $options |
|
| 37 | + * @return null|ISchemaWrapper |
|
| 38 | + */ |
|
| 39 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
| 40 | + /** @var ISchemaWrapper $schema */ |
|
| 41 | + $schema = $schemaClosure(); |
|
| 42 | 42 | |
| 43 | - if (!$schema->hasTable('authorized_groups')) { |
|
| 44 | - $table = $schema->createTable('authorized_groups'); |
|
| 45 | - $table->addColumn('id', 'integer', [ |
|
| 46 | - 'autoincrement' => true, |
|
| 47 | - 'notnull' => true, |
|
| 48 | - ]); |
|
| 49 | - $table->addColumn('group_id', 'string', [ |
|
| 50 | - 'notnull' => true, |
|
| 51 | - 'length' => 200 |
|
| 52 | - ]); |
|
| 53 | - $table->addColumn('class', 'string', [ |
|
| 54 | - 'notnull' => true, |
|
| 55 | - 'length' => 200, |
|
| 56 | - ]); |
|
| 43 | + if (!$schema->hasTable('authorized_groups')) { |
|
| 44 | + $table = $schema->createTable('authorized_groups'); |
|
| 45 | + $table->addColumn('id', 'integer', [ |
|
| 46 | + 'autoincrement' => true, |
|
| 47 | + 'notnull' => true, |
|
| 48 | + ]); |
|
| 49 | + $table->addColumn('group_id', 'string', [ |
|
| 50 | + 'notnull' => true, |
|
| 51 | + 'length' => 200 |
|
| 52 | + ]); |
|
| 53 | + $table->addColumn('class', 'string', [ |
|
| 54 | + 'notnull' => true, |
|
| 55 | + 'length' => 200, |
|
| 56 | + ]); |
|
| 57 | 57 | |
| 58 | - $table->setPrimaryKey(['id']); |
|
| 59 | - $table->addIndex(['group_id'], 'admindel_groupid_idx'); |
|
| 60 | - return $schema; |
|
| 61 | - } |
|
| 62 | - } |
|
| 58 | + $table->setPrimaryKey(['id']); |
|
| 59 | + $table->addIndex(['group_id'], 'admindel_groupid_idx'); |
|
| 60 | + return $schema; |
|
| 61 | + } |
|
| 62 | + } |
|
| 63 | 63 | } |