Skip to content

Commit cd2f536

Browse files
authored
feat(docker): enable skipping db migrations on container startup (#2922)
Adds support for skipping Postgres migrations on container startup via the new `SKIP_POSTGRES_MIGRATIONS` environment variable. Set `SKIP_POSTGRES_MIGRATIONS=1` to skip migrations, matching the existing behavior of `SKIP_CLICKHOUSE_MIGRATIONS`.
1 parent 3056a51 commit cd2f536

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

docker/scripts/entrypoint.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ if [ -n "$DATABASE_HOST" ]; then
55
scripts/wait-for-it.sh ${DATABASE_HOST} -- echo "database is up"
66
fi
77

8-
# Run migrations
9-
echo "Running prisma migrations"
10-
pnpm --filter @trigger.dev/database db:migrate:deploy
11-
echo "Prisma migrations done"
8+
if [ "$SKIP_POSTGRES_MIGRATIONS" != "1" ]; then
9+
echo "Running prisma migrations"
10+
pnpm --filter @trigger.dev/database db:migrate:deploy
11+
echo "Prisma migrations done"
12+
else
13+
echo "SKIP_POSTGRES_MIGRATIONS=1, skipping Postgres migrations."
14+
fi
1215

1316
if [ -n "$CLICKHOUSE_URL" ] && [ "$SKIP_CLICKHOUSE_MIGRATIONS" != "1" ]; then
1417
# Run ClickHouse migrations

0 commit comments

Comments
 (0)