Skip to content

Commit

Permalink
Merge pull request #36407 from nextcloud/enh/31710/migration-safeguard
Browse files Browse the repository at this point in the history
add a safeguard for Version23000Date20210721100600.php
  • Loading branch information
ChristophWurst authored Feb 1, 2023
2 parents 03a6d1a + 96500cf commit d7bd763
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions core/Migrations/Version23000Date20210721100600.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,24 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
/** @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;
}
}
}

0 comments on commit d7bd763

Please sign in to comment.