diff options
author | Simon L <szaimen@e.mail.de> | 2023-02-03 12:58:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-03 12:58:08 +0100 |
commit | 216a8ba3791f17dfc923c474e9035c8eb7420137 (patch) | |
tree | 1c7d09ef3cef164ddd0087c18d7524b2c9f420d7 | |
parent | b06b3f36ad63b1fcffe11f342b5474a0837b5c23 (diff) | |
parent | 69828a5b04aefcfa3f0ee8b19074f5647d3c3f5f (diff) | |
download | nextcloud-server-216a8ba3791f17dfc923c474e9035c8eb7420137.tar.gz nextcloud-server-216a8ba3791f17dfc923c474e9035c8eb7420137.zip |
Merge pull request #36466 from nextcloud/backport/36407/stable25
[stable25] add a safeguard for Version23000Date20210721100600.php
-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 d247811f8b9..1eeba3485b0 100644 --- a/core/Migrations/Version23000Date20210721100600.php +++ b/core/Migrations/Version23000Date20210721100600.php @@ -41,22 +41,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; + } } } |