File tree Expand file tree Collapse file tree 3 files changed +19
-6
lines changed Expand file tree Collapse file tree 3 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 2
2
-- PostgreSQL database dump
3
3
--
4
4
5
- \restrict wWgHHMzQQcpvhWUMpemmi73YWdLM275u3ztj1caKcgLrT0IBN7ueb4BiLBSxtJt
5
+ \restrict SupabaseTestDumpKey123
6
6
7
7
-- Dumped from database version 15.14
8
8
-- Dumped by pg_dump version 15.14
@@ -999,5 +999,5 @@ CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop
999
999
-- PostgreSQL database dump complete
1000
1000
--
1001
1001
1002
- \unrestrict wWgHHMzQQcpvhWUMpemmi73YWdLM275u3ztj1caKcgLrT0IBN7ueb4BiLBSxtJt
1002
+ \unrestrict SupabaseTestDumpKey123
1003
1003
Original file line number Diff line number Diff line change 2
2
-- PostgreSQL database dump
3
3
--
4
4
5
- \restrict wJhXZ3zzSxdOnzT40iWgcbF8W1OVaekHNId1sH6S7U0SApyR73uF8dYaLqibgGY
5
+ \restrict SupabaseTestDumpKey123
6
6
7
7
-- Dumped from database version 17.6
8
8
-- Dumped by pg_dump version 17.6
@@ -1000,5 +1000,5 @@ CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop
1000
1000
-- PostgreSQL database dump complete
1001
1001
--
1002
1002
1003
- \unrestrict wJhXZ3zzSxdOnzT40iWgcbF8W1OVaekHNId1sH6S7U0SApyR73uF8dYaLqibgGY
1003
+ \unrestrict SupabaseTestDumpKey123
1004
1004
Original file line number Diff line number Diff line change @@ -177,7 +177,21 @@ perform_dump() {
177
177
while [ $attempt -le $max_attempts ]; do
178
178
echo " Attempting pg_dump (attempt $attempt /$max_attempts )"
179
179
180
- if " ${PSQLBIN} /pg_dump" -h localhost -p " $PORTNO " -U " $PGSQL_SUPERUSER " -d postgres --schema-only --no-owner --no-privileges > " ./db/schema.sql" ; then
180
+ # Build the dump command
181
+ local dump_cmd=" ${PSQLBIN} /pg_dump -h localhost -p $PORTNO -U $PGSQL_SUPERUSER -d postgres --schema-only --no-owner --no-privileges"
182
+
183
+ # Only use --restrict-key for standard PostgreSQL 15 and 17 versions
184
+ # OrioleDB doesn't support this flag yet
185
+ if [ " $PSQL_VERSION " = " 15" ] || [ " $PSQL_VERSION " = " 17" ]; then
186
+ # Use a fixed restrict key for reproducible test dumps
187
+ # This is safe in testing contexts but should not be used in production
188
+ dump_cmd=" $dump_cmd --restrict-key=SupabaseTestDumpKey123"
189
+ echo " Using --restrict-key for reproducible dumps (PostgreSQL $PSQL_VERSION )"
190
+ else
191
+ echo " Skipping --restrict-key (version: $PSQL_VERSION )"
192
+ fi
193
+
194
+ if $dump_cmd > " ./db/schema.sql" ; then
181
195
return 0
182
196
fi
183
197
@@ -257,7 +271,6 @@ EOSQL
257
271
258
272
echo " CURRENT_SYSTEM: $CURRENT_SYSTEM "
259
273
if [ -f " ./db/schema.sql" ]; then
260
- trim_schema
261
274
cp " ./db/schema.sql" " ./migrations/schema-$PSQL_VERSION .sql"
262
275
echo " Schema file moved to ./migrations/schema-$PSQL_VERSION .sql"
263
276
echo " PSQLBIN is $PSQLBIN "
You can’t perform that action at this time.
0 commit comments