mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-12-07 19:32:02 +01:00
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:
21
sqldb/sqlc/queries/migration.sql
Normal file
21
sqldb/sqlc/queries/migration.sql
Normal 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;
|
||||
Reference in New Issue
Block a user