File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 9797
9898 - name : Verify migration idempotency
9999 run : |
100- psql "${{ env.DATABASE_URL }}" -c "DROP TABLE IF EXISTS storage.migrations;"
100+ pg_dump "$DATABASE_URL" \
101+ --exclude-table-data=storage.migrations \
102+ | grep -v '^\\restrict' \
103+ | grep -v '^\\unrestrict' \
104+ > before.sql
105+
106+ psql "$DATABASE_URL" -c "DROP TABLE IF EXISTS storage.migrations;"
101107 npm run migration:run
108+
109+ pg_dump "$DATABASE_URL" \
110+ --exclude-table-data=storage.migrations \
111+ | grep -v '^\\restrict' \
112+ | grep -v '^\\unrestrict' \
113+ > after.sql
114+
115+ diff before.sql after.sql || (echo 'Schema mismatch!'; exit 1)
116+
102117 env :
103118 PGRST_JWT_SECRET : ${{ secrets.PGRST_JWT_SECRET }}
104119 DATABASE_URL : postgresql://postgres:postgres@127.0.0.1/postgres
You can’t perform that action at this time.
0 commit comments