]> source.dussan.org Git - nextcloud-server.git/commitdiff
add a safeguard for Version23000Date20210721100600.php 36466/head
authorSimon L <szaimen@e.mail.de>
Fri, 27 Jan 2023 12:10:44 +0000 (13:10 +0100)
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>
Wed, 1 Feb 2023 07:58:15 +0000 (07:58 +0000)
Signed-off-by: Simon L <szaimen@e.mail.de>
core/Migrations/Version23000Date20210721100600.php

index d247811f8b9eaf694957d09dc1a92f223c384058..1eeba3485b014c17a806c12f150087646ddb5c91 100644 (file)
@@ -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;
+               }
        }
 }