diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2023-02-01 08:50:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-01 08:50:23 +0100 |
commit | d7bd7639c21fe9de94408198bc7089ebe617ff67 (patch) | |
tree | fa74cc9cc8856cd85c1b5df306b22c97afc85af7 /core | |
parent | 03a6d1a985bf01cb6fb4366c84748ed21bdd4324 (diff) | |
parent | 96500cf5a4ccacb6c1c39e7105766aec6d4125ae (diff) | |
download | nextcloud-server-d7bd7639c21fe9de94408198bc7089ebe617ff67.tar.gz nextcloud-server-d7bd7639c21fe9de94408198bc7089ebe617ff67.zip |
Merge pull request #36407 from nextcloud/enh/31710/migration-safeguard
add a safeguard for Version23000Date20210721100600.php
Diffstat (limited to 'core')
-rw-r--r-- | core/Migrations/Version23000Date20210721100600.php | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/core/Migrations/Version23000Date20210721100600.php b/core/Migrations/Version23000Date20210721100600.php index 99353819f60..1169ca4039e 100644 --- a/core/Migrations/Version23000Date20210721100600.php +++ b/core/Migrations/Version23000Date20210721100600.php @@ -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; + } } } |