Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
Upgrade Flyway
Browse files Browse the repository at this point in the history
  • Loading branch information
solita-antti-mottonen committed Aug 22, 2023
1 parent 13f4942 commit 43b2bab
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docker/flyway.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ cd ../etp-db
clojure -M -m solita.etp.db.flywaydb $1

# Run test migrations to etp_dev
DB_URL="jdbc:postgresql://localhost:5432/etp_dev" clojure -M:test -m solita.etp.db.flywaydb $1
DB_URL="jdbc:postgresql://localhost:5432/etp_dev?ApplicationName=0@etp-migrations" clojure -M:test -m solita.etp.db.flywaydb $1
2 changes: 1 addition & 1 deletion etp-db/deps.edn
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{:paths ["src/main/clj" "src/main/sql" "src/main/resources"]
:deps
{org.clojure/clojure {:mvn/version "1.10.1"}
org.flywaydb/flyway-core {:mvn/version "6.2.0"}
org.flywaydb/flyway-core {:mvn/version "9.21.1"}
org.postgresql/postgresql {:mvn/version "42.2.9"}
ch.qos.logback/logback-classic {:mvn/version "1.2.3"}}
:aliases {:test {:extra-paths ["src/test/sql"]}
Expand Down
5 changes: 3 additions & 2 deletions etp-db/src/main/clj/solita/etp/db/flywaydb.clj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
ConfigUtils/SQL_MIGRATION_PREFIX "v"
ConfigUtils/SQL_MIGRATION_SEPARATOR "-"
ConfigUtils/REPEATABLE_SQL_MIGRATION_PREFIX "r"
ConfigUtils/LOCATIONS "classpath:migration"})
ConfigUtils/LOCATIONS "classpath:migration"
"flyway.postgresql.transactional.lock" "false"})

(defn map-keys [f m] (into {} (map (fn [[k, v]] [(f k) v]) m)))

Expand All @@ -35,7 +36,7 @@
(defn read-configuration []
{:user (env "DB_USER" "etp")
:password (env "DB_PASSWORD" "etp")
:url (env "DB_URL" "jdbc:postgresql://localhost:5432/postgres")})
:url (env "DB_URL" "jdbc:postgresql://localhost:5432/postgres?ApplicationName=0@etp-migrations")})

(defn run [args]
(let [command (str/trim (or (first args) "<empty string>"))
Expand Down

0 comments on commit 43b2bab

Please sign in to comment.