Skip to content

Commit

Permalink
Use insert() to record executed DB migration
Browse files Browse the repository at this point in the history
  • Loading branch information
mstilkerich committed Feb 25, 2021
1 parent 80b3d06 commit 338e8f0
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/Db/Database.php
Expand Up @@ -236,15 +236,7 @@ public function checkMigrations(string $dbPrefix, string $scriptDir): void
return;
}

$dbh->query(
"INSERT INTO " . $dbh->table_name("carddav_migrations") . " (filename) VALUES (?)",
$migration
);

if ($dbh->is_error()) {
$logger->error("Recording exec of migration $migration failed: " . $dbh->is_error());
return;
}
$this->insert('migrations', ['filename'], [ [$migration] ]);
}
}

Expand Down

0 comments on commit 338e8f0

Please sign in to comment.