Skip to content

Commit

Permalink
fix: Check if last_counter column exists before creation
Browse files Browse the repository at this point in the history
* Check if last_counter column exists before creation

Signed-off-by: MaadixNet <contact@maadix.net>
  • Loading branch information
MaadixNet authored Aug 5, 2024
1 parent 7ab4515 commit 6bf4873
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/Migration/Version030000Date20190305114917.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 6bf4873

Please sign in to comment.