Skip to content

Commit

Permalink
Updating crossdata2driver to crossdata (#161)
Browse files Browse the repository at this point in the history
* database migration of old crossdata2 driver to new crossdata driver

* migrating crossdata2 databases to the new crossdata driver
  • Loading branch information
screspo-stratio authored Jan 7, 2020
1 parent 37a4dac commit 8c7ea17
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
5 changes: 1 addition & 4 deletions modules/drivers/crossdata/src/metabase/driver/crossdata.clj
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@
;; refresh values in Metabase cache
(defmethod driver/describe-table :crossdata
[driver {:keys [details] :as database} {table-name :name, schema :schema, :as table}]
(log/debug (u/format-color 'cyan "crossdata.clj->describe-table"))
(println "table-name:" table-name " schema:" schema " table:" table)
; Do a "refresh schema.table" to update metadata. This is mandatory.
(with-open [conn (jdbc/get-connection (sql-jdbc.conn/db->pooled-connection-spec database))]
(jdbc/query {:connection conn}
Expand Down Expand Up @@ -155,8 +153,7 @@
(defmethod driver/execute-query :crossdata
[driver {:keys [database settings], query :native, :as outer-query}]

(log/debug (u/format-color 'cyan "crossdata.clj->execute-query"))
(println "query:" query " outer-query:" outer-query)
(log/debug "query:" query " outer-query:" outer-query)
(let [query (-> (assoc query
:remark (qputil/query->remark outer-query)
:query (if (seq (:params query))
Expand Down
14 changes: 14 additions & 0 deletions resources/migrations/000_migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5291,3 +5291,17 @@ databaseChangeLog:
constraints:
nullable: false
defaultValueBoolean: true

- changeSet:
id: 200
author: screspo
comment: 'Added 0.33.2. Change the old driver crossdata2 to crossata label'
preConditions:
- onFail: MARK_RAN
- onUpdateSQL: IGNORE
- tableExists:
tableName: databasechangelog
changes:
- sql:
dbms: postgresql
sql: update metabase_database set engine = 'crossdata' where engine = 'crossdata2'

0 comments on commit 8c7ea17

Please sign in to comment.