From e09c99cefa1536266e7f792e6f4f6dc256606e4f Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Wed, 2 Jun 2021 15:29:06 +0200 Subject: [PATCH] Nest migration code Signed-off-by: Lukas Reschke --- .../Version22000Date20210525173326.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/core/Migrations/Version22000Date20210525173326.php b/core/Migrations/Version22000Date20210525173326.php index 889cccf8fb..35b5eb5cbe 100644 --- a/core/Migrations/Version22000Date20210525173326.php +++ b/core/Migrations/Version22000Date20210525173326.php @@ -20,14 +20,14 @@ class Version22000Date20210525173326 extends SimpleMigrationStep { /** @var ISchemaWrapper $schema */ $schema = $schemaClosure(); - $table = $schema->createTable('previously_used_userids'); - - $table->addColumn('user_id_hash', \OCP\DB\Types::STRING, [ - 'notnull' => true, - 'length' => 128, - ]); - - $table->setPrimaryKey(['user_id_hash'], 'uid_hash_idx'); + if (!$schema->hasTable('previously_used_userids')) { + $table = $schema->createTable('previously_used_userids'); + $table->addColumn('user_id_hash', \OCP\DB\Types::STRING, [ + 'notnull' => true, + 'length' => 128, + ]); + $table->setPrimaryKey(['user_id_hash'], 'uid_hash_idx'); + } return $schema; }