Custom migrations (#28175)
* Custom migrations Current syntax: specify the migration with ``` - changeSet: id: v46.00-080 author: dpsutton comment: Uppercases all Card names changes: - customChange: class: "metabase.db.custom_migrations.ReversibleUppercaseCards" ``` and in the new namespace metabase.db.custom-migrations: ```clojure (defmigration UppercaseCards (db/execute! {:update :report_card :set {:name :%upper.name}})) (def-reversible-migration ReversibleUppercaseCards (db/execute! {:update :report_card :set {:name :%upper.name}}) (db/execute! {:update :report_card :set {:name :%lower.name}})) ``` * Use db provided by liquibase * edit docstring * set *warn-on-reflection* to fix lint error & rebase --------- Co-authored-by:Noah Moss <noahbmoss@gmail.com> Co-authored-by:
Noah Moss <32746338+noahmoss@users.noreply.github.com>
Showing
- .clj-kondo/config.edn 2 additions, 0 deletions.clj-kondo/config.edn
- bin/lint-migrations-file/src/change/strict.clj 6 additions, 1 deletionbin/lint-migrations-file/src/change/strict.clj
- bin/lint-migrations-file/src/change_set/strict.clj 4 additions, 1 deletionbin/lint-migrations-file/src/change_set/strict.clj
- bin/lint-migrations-file/test/lint_migrations_file_test.clj 38 additions, 5 deletionsbin/lint-migrations-file/test/lint_migrations_file_test.clj
- src/metabase/db/custom_migrations.clj 54 additions, 0 deletionssrc/metabase/db/custom_migrations.clj
- src/metabase/db/setup.clj 1 addition, 0 deletionssrc/metabase/db/setup.clj
Loading
Please register or sign in to comment