Last active
February 24, 2021 22:57
-
-
Save camsaul/d507f14faa78841daafd12c96abb2275 to your computer and use it in GitHub Desktop.
update card viz settings Metabase data migration example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmigration ^{:added "0.39.0"} migrate-map-regions | |
(reduce | |
(fn [_ {card-id :id, {map-region :map.region, :as viz-settings} :visualization_settings}] | |
(when (= map-region "us_states") | |
(let [new-settings (update viz-settings :map.region str/upper-case)] | |
(db/update! Card card-id :visualization_settings new-settings)))) | |
nil | |
(db/select-reducible [Card :id :visualization_settings]))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment