Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#262: Full Flyway integration #276

Merged
merged 5 commits into from
Sep 30, 2024
Merged

Conversation

benedeki
Copy link
Contributor

@benedeki benedeki commented Sep 24, 2024

  • numbered the SQL scripts for Flyway
  • changed PartitioningForDB class to contain keysToValuesMap instead of keysToValues according to validation
  • added sbt alias testAll for running all tests
  • database test for validation function moved to proper folder
  • set flywayBaselineVersion for upgrade purposes

While it's almost 70 files, changes are minimal. In majority of cases it's just a rename.


For the actual upgrade deployment these steps are necessary:

Manual:

sbt -Dflyway.url=<target db url> -Dflyway.password=<postgres user password> flywayBaseline

Add to deployment automation

sbt -Dflyway.url=<target db url> -Dflyway.password=<postgres user password> flywayMigrate

where

  • <target db url> is the database towards which the deployment is running, e.g. "jdbc:postgresql://localhost:5432/atum_db"
  • <postgres user password> is the password for the postgres super user at the above database

Depends on #265
Depends on #267
Depends on #272
Depends on #275

Closes #262

Release notes:

  • Reordered and fixed database structure scripts to allow Flyway usage for incremental migration of existing database (version 0.1.x). Known issues: there might be needed some manual steps if upgrading from database of version 0.2.0.

* numbered the SQL scripts for Flyway
* changed `PartitioningForDB` class to contain `keysToValuesMap` instead of `keysToValues` according to validation
* added sbt alias `testAll` for running all tests
* database test for validation function moved to proper folder
* set `flywayBaselineVersion` for upgrade purposes
Copy link

JaCoCo model module code coverage report - scala 2.13.11

Overall Project 63.64% 🍏

There is no coverage information present for the Files changed

Copy link

JaCoCo agent module code coverage report - scala 2.13.11

Overall Project 84.63% 🍏

There is no coverage information present for the Files changed

Copy link

JaCoCo reader module code coverage report - scala 2.13.11

Overall Project 100% 🍏

There is no coverage information present for the Files changed

Copy link

github-actions bot commented Sep 24, 2024

JaCoCo server module code coverage report - scala 2.13.11

Overall Project 72.57% -0.08% 🍏
Files changed 76%

File Coverage
PartitioningRepositoryImpl.scala 100% 🍏
PartitioningForDB.scala 100% -13.64%
GetFlowPartitionings.scala 70.96% 🍏

@benedeki
Copy link
Contributor Author

Release notes:
Reordered and fixed database structure scripts to allow Flyway usage for incremental migration of existing database (version 0.1.x). Known issues: there might be needed some manual steps if upgrading from database of version 0.2.0.

@benedeki benedeki added dependent The item depends on some other open item (Issue or PR) and removed dependent The item depends on some other open item (Issue or PR) labels Sep 25, 2024
@benedeki benedeki self-assigned this Sep 27, 2024
@benedeki benedeki added dependent The item depends on some other open item (Issue or PR) and removed dependent The item depends on some other open item (Issue or PR) labels Sep 27, 2024
Copy link
Collaborator

@lsulak lsulak left a comment

Choose a reason for hiding this comment

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

LGTM, found a few minor things. But I want to ask: why the numbering like this? For example there is no V0.1.0.3.{sql|ddl} file, so there are gaps. There is V0.1.0.30.ddl instead. So we don't want increments?

…-full-flyway-integration

# Conflicts:
#	database/src/test/scala/za/co/absa/atum/database/runs/GetPartitioningCheckpointsIntegrationTests.scala
@benedeki
Copy link
Contributor Author

LGTM, found a few minor things. But I want to ask: why the numbering like this? For example there is no V0.1.0.3.{sql|ddl} file, so there are gaps. There is V0.1.0.30.ddl instead. So we don't want increments?

It is incremental, but with gaps.
I put the gaps there between folders/schemas number ranges, so in case of testing, if something has to change, I won't be forced to renumber everything. And it actually happened 😉

@benedeki benedeki merged commit 2c1a107 into master Sep 30, 2024
10 checks passed
@benedeki benedeki deleted the feature/262-full-flyway-integration branch September 30, 2024 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Full Flyway integration
3 participants