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

FEATURE - Change order of execution of liquibase changelogs based on release number #3881

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

Agnul97
Copy link
Contributor

@Agnul97 Agnul97 commented Sep 28, 2023

The order of execution of liquibase changelogs was based on the usage of some master changelog files, defined for each module containing liquibase scripts. These master files defined the order of execution of changelogs but did not prioritize the version number to order the executions of them. Here a new way of executing changelogs is proposed that executes them ordering on the version number. This means that, first, all changelogs of the first release are executed, then all changelogs of the second release, and so on.
Consider the case in which, for example, a certain script for a version changed the name of a table or column, and some liquibase scripts of an older version still reference the old name...it is important to execute those scripts in order of version. This kind of problem could happen taking into account the module "kapua-foreignkeys": think the case where the definition of a foreign key references a table that has been renamed, at a point in future time, by another changelog.

Description of the solution adopted
The kapuaLiquibaseClient has been properly updated to implement the new ordering of changelogs executions.

A global addition to changelog files was needed: the inclusion of a reference to the common.xml file. In fact, before, thanks to the usage of master changelogs files, it could happen that some of the first changelogs were including this common file, and then the subsequent changelogs in the chain would pick it indirectly from the common "context".

Some changelogs were not adhering to the pre-post ordering principle so I modified their names.

@Agnul97 Agnul97 changed the title FEATURE - Change order of executiuon of liquibase changelogs now based on release number FEATURE - Change order of execution of liquibase changelogs based on release number Sep 29, 2023
@Agnul97 Agnul97 force-pushed the fix-changeOrderLiquibaseScripts branch from 31c1b50 to a03685a Compare September 29, 2023 07:32
@codecov
Copy link

codecov bot commented Sep 29, 2023

Codecov Report

Merging #3881 (2081813) into develop (b42f840) will increase coverage by 0.01%.
The diff coverage is 92.85%.

❗ Current head 2081813 differs from pull request most recent head a03685a. Consider uploading reports for the commit a03685a to get more accurate results

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #3881      +/-   ##
=============================================
+ Coverage      20.58%   20.59%   +0.01%     
  Complexity         6        6              
=============================================
  Files           1936     1936              
  Lines          41532    41542      +10     
  Branches        3945     3947       +2     
=============================================
+ Hits            8549     8557       +8     
- Misses         32586    32587       +1     
- Partials         397      398       +1     
Files Coverage Δ
.../kapua/commons/liquibase/KapuaLiquibaseClient.java 80.35% <92.85%> (-0.04%) ⬇️

@Agnul97 Agnul97 marked this pull request as draft October 4, 2023 09:10
@Agnul97 Agnul97 marked this pull request as ready for review October 13, 2023 08:20
@Agnul97 Agnul97 marked this pull request as draft November 8, 2023 14:51
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.

1 participant