Skip to content

Commit

Permalink
Run timescale DB tune script on DB migration
Browse files Browse the repository at this point in the history
  • Loading branch information
richturner committed Mar 29, 2023
1 parent ca48317 commit ceec7d5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions or-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ if [ -n "$DATABASE_ALREADY_EXISTS" ]; then
else
echo "Adding shared_preload_libraries = 'timescaledb' to postgresql.conf"
echo "shared_preload_libraries = 'timescaledb'" >> "$PGDATA/postgresql.conf"
echo "timescaledb.telemetry_level=off" >> "$PGDATA/postgresql.conf"
fi

# Do re-indexing check
if [ "$OR_DISABLE_REINDEX" == 'true' ] || [ -z "$OR_REINDEX_COUNTER" ]; then
echo "REINDEX check is disabled"
Expand All @@ -28,8 +29,11 @@ if [ -n "$DATABASE_ALREADY_EXISTS" ]; then
if [ -f "$REINDEX_FILE" ]; then
echo "REINDEX file '$REINDEX_FILE' already exists so no re-indexing required"
else
echo "REINDEX file '$REINDEX_FILE' doesn't exist so re-indexing the DB..."
echo "REINDEX file '$REINDEX_FILE' doesn't exist"
docker_temp_server_start "$@"
echo "Running timescaledb tune script..."
/docker-entrypoint-initdb.d/001_timescaledb_tune.sh
echo "Re-indexing the DB..."
docker_process_sql -c "REINDEX database $POSTGRES_DB;"
docker_temp_server_stop
echo 'REINDEX completed!'
Expand Down

0 comments on commit ceec7d5

Please sign in to comment.