Skip to content
Snippets Groups Projects
Commit 85fe09a6 authored by Sameer Al-Sakran's avatar Sameer Al-Sakran Committed by GitHub
Browse files

Merge pull request #5587 from metabase/ensure-site-url-has-protocol

Ensure that the stored site-url has the protocol specified [ci all]
parents e835cb06 99121ef2
Branches
Tags
No related merge requests found
......@@ -369,3 +369,15 @@
(defmigration ^{:author "camsaul", :added "0.23.0"} drop-old-query-execution-table
;; DROP TABLE IF EXISTS should work on Postgres, MySQL, and H2
(jdbc/execute! (db/connection) [(format "DROP TABLE IF EXISTS %s;" ((db/quote-fn) "query_queryexecution"))]))
;; There's a window on in the 0.23.0 and 0.23.1 releases that the
;; site-url could be persisted without a protocol specified. Other
;; areas of the application expect that site-url will always include
;; http/https. This migration ensures that if we have a site-url
;; stored it has the current defaulting logic applied to it
(defmigration ^{:author "senior", :added "0.25.1"} ensure-protocol-specified-in-site-url
(let [stored-site-url (db/select-one-field :value Setting :key "site-url")
defaulted-site-url (public-settings/site-url stored-site-url)]
(when (and stored-site-url
(not= stored-site-url defaulted-site-url))
(setting/set! "site-url" stored-site-url))))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment