|
|
|
@ -24,9 +24,9 @@
|
|
|
|
|
c.last_migration = ''")
|
|
|
|
|
|
|
|
|
|
(neo4j/defquery merge-config
|
|
|
|
|
"UPDATE (c:dbconfig)
|
|
|
|
|
SET c.last_migration = {now},
|
|
|
|
|
c.db_version = {version}")
|
|
|
|
|
"MATCH (c:dbconfig)
|
|
|
|
|
SET c.last_migration = {now},
|
|
|
|
|
c.db_version = {version}")
|
|
|
|
|
|
|
|
|
|
(neo4j/defquery config
|
|
|
|
|
"MATCH (c:dbconfig) RETURN c")
|
|
|
|
@ -96,9 +96,9 @@
|
|
|
|
|
(defn run-migrations! []
|
|
|
|
|
(neo4j/exec-query! init-config {:now (neo4j/now-str)})
|
|
|
|
|
(let [version (-> (neo4j/exec-query! config {})
|
|
|
|
|
first
|
|
|
|
|
:c
|
|
|
|
|
:db_version)]
|
|
|
|
|
first
|
|
|
|
|
:c
|
|
|
|
|
:db_version)]
|
|
|
|
|
(println "got version" version "from db," (count migrations) "available")
|
|
|
|
|
(when-let [to-run (nthrest migrations version)]
|
|
|
|
|
(println "running" (count to-run) "migrations")
|
|
|
|
|