feature #2: save executed migration in DB
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
DELETE
|
||||
FROM migration.history
|
||||
WHERE filename = :filename;
|
||||
WHERE filename = ?;
|
||||
@@ -1,2 +1,2 @@
|
||||
SELECT json_object_agg(filename, f)
|
||||
SELECT json_agg(f order by f.version)
|
||||
FROM migration.functions f;
|
||||
@@ -1,2 +1,2 @@
|
||||
SELECT json_object_agg(filename, f)
|
||||
FROM migration.functions f;
|
||||
SELECT json_agg(h order by h.version)
|
||||
FROM migration.history h;
|
||||
@@ -1,2 +1,3 @@
|
||||
INSERT INTO migration.functions (filename, definition, up, down, version)
|
||||
VALUES (:filename, :definition, :up, :down, :version);
|
||||
INSERT INTO migration.functions as f (filename, definition, executed_at, up, down, version)
|
||||
VALUES (?, ?, now(), ?, ?, ?)
|
||||
RETURNING to_json(f);
|
||||
@@ -1,2 +1,3 @@
|
||||
INSERT INTO migration.history (filename, up, down, version)
|
||||
VALUES (:filename, :up, :down, :version);
|
||||
INSERT INTO migration.history as h (filename, executed_at, up, down, version)
|
||||
VALUES (?, now(), ?, ?, nextval('migration.version_seq'))
|
||||
RETURNING to_json(h);
|
||||
|
||||
Reference in New Issue
Block a user