-- name: migration-0000-create-migrations#
CREATE TABLE IF NOT EXISTS migrations (
   id INTEGER PRIMARY KEY AUTOINCREMENT
 , name TEXT
 , fingerprint TEXT
 , executed_at TEXT DEFAULT (datetime('now'))
 , UNIQUE(name)
);

-- name: list-migrations
SELECT
   *
FROM migrations
ORDER BY
   datetime(executed_at) ASC
;

-- name: record-migration!
INSERT INTO migrations (
   name
 , fingerprint
)
VALUES (
   :name
 , :fingerprint
);
