You are on page 1of 4

Restructured the DB script under "database/upgrade/" to

support cloud deployment (Flyway).

As per our current merge process, we just copy the respective release folder from
the source code line “database/upgrade” to the targeted code line under
“database/upgrade” folder.

For example: In spring2020, if we are planning to merge 7-10-4-2-14, 7-10-1-3-5.


Therefore, on spring 2020 code line under the “database/upgrade” there will be copied these
two folders 7-10-4-2-14 and 7-10-1-3-5 as it is as a part of merge activity and for the current
release if there are any DDL or DML script would have introduced in spring2020 then that
would be part of spring2020 folder 2020-1-0-0.

As per new structure only source files will copy from the respective folder into
current release folder and renamed the existing name by adding with their release
name as a prefix.

Note while adding release name as a prefix, use dot “.” in the place of hyphen “– “because
currently there is some limitation with flyway to understand hyphen in the file name.

For example: database/upgrade/7-10-1-3-5/01_010_seed_data_update.sql Merge into


Spring2020:
database/upgrade/2020-1-0-0/7.10.1.3.5_01_010_seed_data_update.sql

And if any db script introduced into spring2020 then then name start with current release name
itself.
For Example: database/upgrade/2020-1-0-0/2020.1.0.0_01_dml_script.sql
As per the new structure “database/upgrade” folder will contain only seasonal release folders
and active code line related folders.
For example:
Summer 19 HF code line, here from 7-10-5-0-0 to 2019-2-0-0 are seasonal releases folder and
2019-2-0-1 – 2019-2-0-2 are active code line related folder.

Spring 2020 Code line, here from 7-10-5-0-0 to 2019-3-0-0 are seasonal releases folder and
2020-1-0-0 is the active code line related folder.

Note: The similar kind of exercise need to be done for all active code lines, extract the files from source
(merge) folder and copy to that release folder where it has been merged in past during merge activity.
We did for all previous releases but here taking example only winter2019. As new per new structure
extract the files and renamed the existing name by adding with their release name as a prefix and
copied to winter 2019 folder 2019-3-0-0.
Key Point need to be taken care while creating db script.

1.) Going forward all DB script file name needs to be created by adding release name as a prefix for
all kind of releases.
2.) All DB script should be re executable.
3.) All data correction script should be independent it should not be referring any source packages
procedures and functions because there maybe chance they can in invalid state during flyway
execution.

You might also like