sqldb: add table to track custom SQL migrations

This commit adds the migration_tracker table which we'll use to track if
a custom migration has already been done.
This commit is contained in:
Andras Banki-Horvath committed 2025-01-23 09:10:59 +01:00
1 parent 680394518f
commit 9acd06d296
6 files changed
+108

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
-- name: SetMigration :exec
INSERT INTO
migration_tracker (version, migration_time)
VALUES ($1, $2);
-- name: GetMigration :one
SELECT
migration_time
FROM
migration_tracker
WHERE
version = $1;
-- name: GetDatabaseVersion :one
SELECT
version
FROM
migration_tracker
ORDER BY
version DESC
LIMIT 1;