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

Upgrade Flyway #933

Merged
merged 4 commits into from
Aug 25, 2023
Merged

Conversation

solita-antti-mottonen
Copy link
Contributor

@solita-antti-mottonen solita-antti-mottonen commented Aug 21, 2023

In 9.1.4 Flyway changed to use transactional locks, but it causes
migrations to freeze. Reverted to old default.

In 9.19.0 something breaks. Audit tables create a log of added kayttaja
entries. The audit log try to use the function current_kayttaja_id(),
which relies on "application name" being set. It's set in
beforeMigration.sql, but for some reason it doesn't work anymore. The
script gets executed, so maybe there are multiple connections? Added
ApplicationName to connection url to get around the problem.

@solita-antti-mottonen solita-antti-mottonen force-pushed the feature/AE-1909-upgrade-flyway branch 5 times, most recently from 57e03f7 to a01ba3e Compare August 22, 2023 09:33
In 9.1.4 Flyway changed to use transactional locks, but it causes
migrations to freeze. Reverted to old default.

In 9.19.0 breaks things. Audit tables create a log of added kayttaja
entries. The audit log try to use the function current_kayttaja_id(),
which relies on "application name" being set. It's set in
beforeMigration.sql, but in this version callbacks have a separate
connection. Added ApplicationName to connection url to get around the
problem.

Implements: AE-1909
:password (env "DB_PASSWORD" "etp")
:url (env "DB_URL" "jdbc:postgresql://localhost:5432/postgres")})
(let [url (env "DB_URL" "jdbc:postgresql://localhost:5432/postgres")
existing-query (-> url (str/split #"\?" 2) (get 1))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Saisiko tästä ja seuraavasta rivistä jotenkin selvennettyä, että mitä tässä oikein tapahtuu? Ei ole omaan silmään mitenkään selkeää.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ehkä jopa omaksi funktiokseen eriyttäminen ja testien kirjoittaminen voisi olla hyvä?

"Add ApplicationName to query parameters of the given url.

Example:
http://localhost:5763/db => http://localhost:5736?ApplicationName=0@database.etp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Portissa on typo kun se muuttuu tuossa syötteen ja esimerkkipaluuarvon välillä ja tuo db:kin tuossa häviää

@solita-antti-mottonen solita-antti-mottonen merged commit c951062 into develop Aug 25, 2023
4 checks passed
@solita-antti-mottonen solita-antti-mottonen deleted the feature/AE-1909-upgrade-flyway branch August 25, 2023 06:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants