Browse Source

Merge pull request #36407 from nextcloud/enh/31710/migration-safeguard

add a safeguard for Version23000Date20210721100600.php
tags/v26.0.0beta2
Christoph Wurst 1 year ago
parent
commit
d7bd7639c2
No account linked to committer's email address
1 changed files with 19 additions and 17 deletions
  1. 19
    17
      core/Migrations/Version23000Date20210721100600.php

+ 19
- 17
core/Migrations/Version23000Date20210721100600.php View File

@@ -40,22 +40,24 @@ class Version23000Date20210721100600 extends SimpleMigrationStep {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$table = $schema->createTable('authorized_groups');
$table->addColumn('id', 'integer', [
'autoincrement' => true,
'notnull' => true,
]);
$table->addColumn('group_id', 'string', [
'notnull' => true,
'length' => 200
]);
$table->addColumn('class', 'string', [
'notnull' => true,
'length' => 200,
]);

$table->setPrimaryKey(['id']);
$table->addIndex(['group_id'], 'admindel_groupid_idx');
return $schema;
if (!$schema->hasTable('authorized_groups')) {
$table = $schema->createTable('authorized_groups');
$table->addColumn('id', 'integer', [
'autoincrement' => true,
'notnull' => true,
]);
$table->addColumn('group_id', 'string', [
'notnull' => true,
'length' => 200
]);
$table->addColumn('class', 'string', [
'notnull' => true,
'length' => 200,
]);
$table->setPrimaryKey(['id']);
$table->addIndex(['group_id'], 'admindel_groupid_idx');
return $schema;
}
}
}

Loading…
Cancel
Save