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