From 6bf4873e531d5d3e919fe88bac6a936b4f2aa8b6 Mon Sep 17 00:00:00 2001 From: Maadix <20930277+MaadixNet@users.noreply.github.com> Date: Mon, 5 Aug 2024 13:19:39 +0200 Subject: [PATCH] fix: Check if last_counter column exists before creation * Check if last_counter column exists before creation Signed-off-by: MaadixNet --- lib/Migration/Version030000Date20190305114917.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/Migration/Version030000Date20190305114917.php b/lib/Migration/Version030000Date20190305114917.php index cbf5fe579..b061b7a37 100644 --- a/lib/Migration/Version030000Date20190305114917.php +++ b/lib/Migration/Version030000Date20190305114917.php @@ -22,12 +22,13 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $schema = $schemaClosure(); $table = $schema->getTable('twofactor_totp_secrets'); - // TODO: use \OCP\DB\Types::BIGINT - $table->addColumn('last_counter', 'bigint', [ - 'notnull' => true, - 'default' => -1, - ]); - + if (!$table->hasColumn('last_counter')) { + // TODO: use \OCP\DB\Types::BIGINT + $table->addColumn('last_counter', 'bigint', [ + 'notnull' => true, + 'default' => -1, + ]); + } return $schema; } }