Skip to content

Commit

Permalink
Fixes #15416: Create migration script for parent ticket
Browse files Browse the repository at this point in the history
  • Loading branch information
ncharles committed Aug 6, 2019
1 parent a7ca148 commit b74cb90
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion rudder-webapp/SOURCES/rudder-upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ upgrade_database() {
fi

# - 5.0.7: Tune autovacuum on a table basis
RES=$(${PSQL} -t -d ${SQL_DATABASE} -c "select reloptions from pg_class where relname='ruddersysevents'" | grep -c "autovacuum" || true)
RES=$(${PSQL} -t -d ${SQL_DATABASE} -c "select reloptions from pg_class where relname='reportsexecution'" | grep -c "autovacuum" || true)
if [ $RES -eq 0 ]; then
echo -n "INFO: Adapting autovacuum configuration on a table basis"
${PSQL} -d ${SQL_DATABASE} -f ${RUDDER_UPGRADE_TOOLS}/dbMigration-5.0.x-5.0.7-tune-autovacuum_on_table_basis.sql > /dev/null
Expand All @@ -563,6 +563,14 @@ upgrade_database() {
echo " Done"
fi

# - 5.0.13: Remove autovacuum on ruddersysevent table
RES=$(${PSQL} -t -d ${SQL_DATABASE} -c "select reloptions from pg_class where relname='ruddersysevents'" | grep -c "autovacuum_vacuum_scale_factor" || true)
if [ $RES -ne 0 ]; then
echo -n "INFO: Removing autovacuum configuration on ruddersysevents"
${PSQL} -d ${SQL_DATABASE} -f ${RUDDER_UPGRADE_TOOLS}/dbMigration-5.0.x-5.0.13-remove-autovacuum-on-ruddersysevents.sql > /dev/null
echo " Done"
fi

# Now check the fileFormat in the eventlog
upgrade_eventlog

Expand Down

0 comments on commit b74cb90

Please sign in to comment.