Skip to content

Commit

Permalink
Fixed lack of database migration during some upgrades
Browse files Browse the repository at this point in the history
TODO: add some details about when it didn't migrate.

Ticket: ENT-12045
Changelog: title
  • Loading branch information
craigcomstock committed Nov 8, 2024
1 parent 53d0583 commit 413850b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packaging/common/cfengine-hub/preinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ if is_upgrade; then
fi

# If upgrading from a version below 3.21 that has PostgreSQL, and the data dir exists.
cf_console echo "is_upgrade is ${is_upgrade}"
cf_console_echo "UPGRADED_FROM.txt contains: " $(cat "$PREFIX/UPGRADED_FROM.txt")
cf_console_echo "$PREFIX/state/pg/data exists? " $(stat "$PREFIX/state/pg/data")
if is_upgrade && egrep '^3\.([6-9]|1[0-9]|2[0-3])\.' "$PREFIX/UPGRADED_FROM.txt" >/dev/null && [ -d "$PREFIX/state/pg/data" ]; then
alias migrating_postgres='true'
else
Expand Down

0 comments on commit 413850b

Please sign in to comment.