Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DSL/Liquibase/liquibase.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
changelogFile: /changelog/changelog.yaml
changelogFile: /changelog/master.yaml
url: jdbc:postgresql://database:5432/services_db
username: byk
password: 01234
Expand Down
2 changes: 1 addition & 1 deletion DSL/Liquibase/changelog.yaml → DSL/Liquibase/master.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
databaseChangeLog:
- includeAll:
path: changelog/
maxDepth: 1
errorIfMissingOrEmpty: true
9 changes: 7 additions & 2 deletions create-migration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@ if [[ $# -eq 0 ]] ; then
exit 0
fi

echo "-- liquibase formatted sql" > "DSL/Liquibase/changelog/`date '+%s'`-$1.sql"
echo "-- changeset $(git config user.name):`date '+%s'`" >> "DSL/Liquibase/changelog/`date '+%s'`-$1.sql"
timestamp=$(date '+%Y%m%d%H%M%S')
migration_file="DSL/Liquibase/changelog/${timestamp}-$1.sql"

echo "-- liquibase formatted sql" > "$migration_file"
echo "-- changeset $(git config user.name):$timestamp" >> "$migration_file"

echo "Migration file created: $migration_file"
8 changes: 1 addition & 7 deletions migrate.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
#!/bin/bash
docker run --rm --network bykstack \
-v $(pwd)/DSL/Liquibase:/workspace \
-w /workspace \
liquibase/liquibase \
--defaultsFile=liquibase.properties \
--changelog-file=changelog.yaml \
update
docker run --rm --network bykstack -v `pwd`/DSL/Liquibase/changelog:/liquibase/changelog -v `pwd`/DSL/Liquibase/master.yml:/liquibase/master.yml -v `pwd`/DSL/Liquibase/data:/liquibase/data liquibase/liquibase:4.28 --defaultsFile=/liquibase/changelog/liquibase.properties --changelog-file=master.yml --url=jdbc:postgresql://database:5432/services_db?user=byk --password=01234 update

Check warning on line 2 in migrate.sh

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace backticks with '$()' syntax for command substitution.

See more on https://sonarcloud.io/project/issues?id=buerokratt_Service-Module&issues=AZ-yWIESkBgWPb8o5pw2&open=AZ-yWIESkBgWPb8o5pw2&pullRequest=1133

Check warning on line 2 in migrate.sh

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace backticks with '$()' syntax for command substitution.

See more on https://sonarcloud.io/project/issues?id=buerokratt_Service-Module&issues=AZ-yWIETkBgWPb8o5pw3&open=AZ-yWIETkBgWPb8o5pw3&pullRequest=1133

Check warning on line 2 in migrate.sh

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace backticks with '$()' syntax for command substitution.

See more on https://sonarcloud.io/project/issues?id=buerokratt_Service-Module&issues=AZ-yWIETkBgWPb8o5pw4&open=AZ-yWIETkBgWPb8o5pw4&pullRequest=1133