Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ansible/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ postgres_major:

# Full version strings for each major version
postgres_release:
postgresorioledb-17: "17.5.1.021-orioledb"
postgres17: "17.4.1.078"
postgres15: "15.8.1.135"
postgresorioledb-17: "17.5.1.018-orioledb"
postgres17: "17.6.1.000"
postgres15: "15.14.1.000"

# Non Postgres Extensions
pgbouncer_release: "1.19.0"
Expand Down
8 changes: 6 additions & 2 deletions migrations/schema-15.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
-- PostgreSQL database dump
--

-- Dumped from database version 15.8
-- Dumped by pg_dump version 15.8
\restrict SupabaseTestDumpKey123

-- Dumped from database version 15.14
-- Dumped by pg_dump version 15.14

SET statement_timeout = 0;
SET lock_timeout = 0;
Expand Down Expand Up @@ -997,3 +999,5 @@ CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop
-- PostgreSQL database dump complete
--

\unrestrict SupabaseTestDumpKey123

8 changes: 6 additions & 2 deletions migrations/schema-17.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
-- PostgreSQL database dump
--

-- Dumped from database version 17.4
-- Dumped by pg_dump version 17.4
\restrict SupabaseTestDumpKey123

-- Dumped from database version 17.6
-- Dumped by pg_dump version 17.6

SET statement_timeout = 0;
SET lock_timeout = 0;
Expand Down Expand Up @@ -998,3 +1000,5 @@ CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop
-- PostgreSQL database dump complete
--

\unrestrict SupabaseTestDumpKey123

8 changes: 4 additions & 4 deletions nix/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ in
supportedPostgresVersions = {
postgres = {
"15" = {
version = "15.8";
hash = "sha256-RANRX5pp7rPv68mPMLjGlhIr/fiV6Ss7I/W452nty2o=";
version = "15.14";
hash = "sha256-Bt110wXNOHDuYrOTLmYcYkVD6vmuK6N83sCk+O3QUdI=";
};
"17" = {
version = "17.4";
hash = "sha256-xGBbc/6hGWNAZpn5Sblm5dFzp+4Myu+JON7AyoqZX+c=";
version = "17.6";
hash = "sha256-4GMKNgCuonURcVVjJZ7CERzV9DU6SwQOC+gn+UzXqLA=";
};
};
orioledb = {
Expand Down
17 changes: 15 additions & 2 deletions nix/tools/dbmate-tool.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,21 @@ perform_dump() {
while [ $attempt -le $max_attempts ]; do
echo "Attempting pg_dump (attempt $attempt/$max_attempts)"

if "${PSQLBIN}/pg_dump" -h localhost -p "$PORTNO" -U "$PGSQL_SUPERUSER" -d postgres --schema-only --no-owner --no-privileges > "./db/schema.sql"; then
# Build the dump command
local dump_cmd="${PSQLBIN}/pg_dump -h localhost -p $PORTNO -U $PGSQL_SUPERUSER -d postgres --schema-only --no-owner --no-privileges"

# Only use --restrict-key for standard PostgreSQL 15 and 17 versions
# OrioleDB doesn't support this flag yet
if [ "$PSQL_VERSION" = "15" ] || [ "$PSQL_VERSION" = "17" ]; then
# Use a fixed restrict key for reproducible test dumps
# This is safe in testing contexts but should not be used in production
dump_cmd="$dump_cmd --restrict-key=SupabaseTestDumpKey123"
echo "Using --restrict-key for reproducible dumps (PostgreSQL $PSQL_VERSION)"
else
echo "Skipping --restrict-key (version: $PSQL_VERSION)"
fi

if $dump_cmd > "./db/schema.sql"; then
return 0
fi

Expand Down Expand Up @@ -257,7 +271,6 @@ EOSQL

echo "CURRENT_SYSTEM: $CURRENT_SYSTEM"
if [ -f "./db/schema.sql" ]; then
trim_schema
cp "./db/schema.sql" "./migrations/schema-$PSQL_VERSION.sql"
echo "Schema file moved to ./migrations/schema-$PSQL_VERSION.sql"
echo "PSQLBIN is $PSQLBIN"
Expand Down
Loading