Skip to content
Snippets Groups Projects
Unverified Commit 0637fefa authored by John Swanson's avatar John Swanson Committed by GitHub
Browse files

Fix dev `migrate!` command (#44545)

There were two problems here:

- wrong args to `mdb/migrate!` (passing the db-type as well as the data
source), and

- in MySQL, the changelog table name is not `:databasechangelog`. Use
`metabase.db.liquibase/changelog-table-name` to get the actual table name.
parent 74b2c11e
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@
[]
((juxt :id :comments)
(t2/query-one {:select [:id :comments]
:from [:databasechangelog]
:from [(keyword (liquibase/changelog-table-name (mdb/data-source)))]
:order-by [[:orderexecuted :desc]]
:limit 1})))
(defn migrate!
......@@ -24,8 +24,7 @@
(migrate! :up))
;; do we really use this in dev?
([direction & [version]]
(mdb/migrate! (mdb/db-type) (mdb/data-source)
direction version)
(mdb/migrate! (mdb/data-source) direction version)
#_{:clj-kondo/ignore [:discouraged-var]}
(println "Migrated up. Latest migration:" (latest-migration))))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment