assessment-model/migration-correction-script.sh
2026-06-03 12:55:49 +00:00

5 lines
292 B
Bash

set -ex
for f in src/app/db/migrations/*.sql; do
hash=$(sha256sum "$f" | awk '{print $1}')
echo "INSERT INTO __drizzle_migrations (hash, created_at) SELECT '$hash', extract(epoch from now())::bigint * 1000 WHERE NOT EXISTS (SELECT 1 FROM __drizzle_migrations WHERE hash = '$hash');"
done