Skip to content
Snippets Groups Projects
Commit 48f73bcc authored by Allen Gilliland's avatar Allen Gilliland
Browse files

indentation.

parent 510ce2f4
No related branches found
No related tags found
No related merge requests found
......@@ -53,13 +53,13 @@
hostname (or (config/config-str :mb-jetty-host) "localhost")
port (config/config-int :mb-jetty-port)
setup-url (str "http://"
(or hostname "localhost")
(when-not (= 80 port) (str ":" port))
"/setup/init/"
setup-token)]
(or hostname "localhost")
(when-not (= 80 port) (str ":" port))
"/setup/init/"
setup-token)]
(log/info (str "Please use the following url to setup your Metabase installation:\n\n"
setup-url
"\n\n"))))
setup-url
"\n\n"))))
(log/info "Metabase Initialization COMPLETE")
true)
......@@ -81,11 +81,11 @@
:min-threads (config/config-int :mb-jetty-minthreads)
:max-queued (config/config-int :mb-jetty-maxqueued)
:max-idle-time (config/config-int :mb-jetty-maxidletime)})
(config/config-str :mb-jetty-join) (assoc :join? (config/config-bool :mb-jetty-join))
(config/config-str :mb-jetty-daemon) (assoc :daemon? (config/config-bool :mb-jetty-daemon)))]
(config/config-str :mb-jetty-join) (assoc :join? (config/config-bool :mb-jetty-join))
(config/config-str :mb-jetty-daemon) (assoc :daemon? (config/config-bool :mb-jetty-daemon)))]
(log/info "Launching Embedded Jetty Webserver with config:\n" (with-out-str (clojure.pprint/pprint jetty-config)))
(->> (ring-jetty/run-jetty app jetty-config)
(reset! jetty-instance)))))
(reset! jetty-instance)))))
(defn stop-jetty
"Stop the embedded Jetty web server."
......
......@@ -40,20 +40,20 @@
[]
{:post [(map? %)]}
(or (sel :one Database :name db-name)
(do (when-not (.exists (clojure.java.io/file (str @test-db-filename ".mv.db"))) ; only create + populate the test DB file if needed
(create-and-populate-tables))
(log/info "Creating new metabase Database object...")
(let [db (ins Database
:organization_id (:id (test-org))
:name db-name
:engine :h2
:details {:conn_str @test-db-connection-string})]
(log/info "Syncing Tables...")
(driver/sync-tables db)
(log/info "Adding Schema Metadata...")
(add-metadata)
(log/info "Finished. Enjoy your test data <3")
db))))
(do (when-not (.exists (clojure.java.io/file (str @test-db-filename ".mv.db"))) ; only create + populate the test DB file if needed
(create-and-populate-tables))
(log/info "Creating new metabase Database object...")
(let [db (ins Database
:organization_id (:id (test-org))
:name db-name
:engine :h2
:details {:conn_str @test-db-connection-string})]
(log/info "Syncing Tables...")
(driver/sync-tables db)
(log/info "Adding Schema Metadata...")
(add-metadata)
(log/info "Finished. Enjoy your test data <3")
db))))
;; ## Debugging/Interactive Development Functions
......@@ -76,11 +76,11 @@
"Binds `*test-db*` if not already bound to a Korma DB entity and executes BODY."
[& body]
`(if *test-db* (do ~@body)
(binding [*test-db* (create-db (h2 {:db @test-db-connection-string
:naming {:keys s/lower-case
:fields s/upper-case}}))]
(log/info "CREATING H2 TEST DATABASE...")
~@body)))
(binding [*test-db* (create-db (h2 {:db @test-db-connection-string
:naming {:keys s/lower-case
:fields s/upper-case}}))]
(log/info "CREATING H2 TEST DATABASE...")
~@body)))
(defn- exec-sql
"Execute raw SQL STATEMENTS against the test database."
......@@ -150,18 +150,18 @@
(upd Field (:id venues-lat-field) :special_type "latitude")
(upd Field (:id venues-long-field) :special_type "longitude")
(ins ForeignKey
:origin_id (:id venues-cat-field)
:destination_id (:id categories-id-field)
:relationship "Mt1")
:origin_id (:id venues-cat-field)
:destination_id (:id categories-id-field)
:relationship "Mt1")
;; setup CHECKINS table metadata
(upd Field (:id checkins-id-field) :special_type "id")
(upd Field (:id checkins-user-field) :special_type "fk")
(upd Field (:id checkins-venues-field) :special_type "fk")
(ins ForeignKey
:origin_id (:id checkins-user-field)
:destination_id (:id user-id-field)
:relationship "Mt1")
:origin_id (:id checkins-user-field)
:destination_id (:id user-id-field)
:relationship "Mt1")
(ins ForeignKey
:origin_id (:id checkins-venues-field)
:destination_id (:id venues-id-field)
:relationship "Mt1")))
:origin_id (:id checkins-venues-field)
:destination_id (:id venues-id-field)
:relationship "Mt1")))
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