#!/bin/sh # Applied by postgres on first container startup via /docker-entrypoint-initdb.d. # drizzle-kit migration files use "--> statement-breakpoint" markers which are # not valid SQL — strip them before applying. set -e for f in /migrations/*.sql; do echo "Applying $f..." sed '/^-->/d' "$f" | psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" done echo "All migrations applied."