diff --git a/core/Migrations/Version23000Date20210721100600.php b/core/Migrations/Version23000Date20210721100600.php index d247811f8b9ea..1eeba3485b014 100644 --- a/core/Migrations/Version23000Date20210721100600.php +++ b/core/Migrations/Version23000Date20210721100600.php @@ -41,22 +41,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; + } } }