diff options
author | Simon L <szaimen@e.mail.de> | 2023-01-27 13:10:44 +0100 |
---|---|---|
committer | Simon L <szaimen@e.mail.de> | 2023-01-27 13:10:44 +0100 |
commit | 96500cf5a4ccacb6c1c39e7105766aec6d4125ae (patch) | |
tree | 642fd7bfa6f8dee90e6296fd9aaac5b5f0d4d434 | |
parent | a63b5575687bb838c82f86a11a1545668157dc71 (diff) | |
download | nextcloud-server-96500cf5a4ccacb6c1c39e7105766aec6d4125ae.tar.gz nextcloud-server-96500cf5a4ccacb6c1c39e7105766aec6d4125ae.zip |
add a safeguard for Version23000Date20210721100600.php
Signed-off-by: Simon L <szaimen@e.mail.de>
-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; + } } } |