diff --git a/ansible/vars.yml b/ansible/vars.yml index 385f29f7d..6c04ad83d 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -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" diff --git a/migrations/schema-15.sql b/migrations/schema-15.sql index 00e62c8eb..1f1d98496 100644 --- a/migrations/schema-15.sql +++ b/migrations/schema-15.sql @@ -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; @@ -997,3 +999,5 @@ CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop -- PostgreSQL database dump complete -- +\unrestrict SupabaseTestDumpKey123 + diff --git a/migrations/schema-17.sql b/migrations/schema-17.sql index f120b1b27..e0b353e9d 100644 --- a/migrations/schema-17.sql +++ b/migrations/schema-17.sql @@ -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; @@ -998,3 +1000,5 @@ CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop -- PostgreSQL database dump complete -- +\unrestrict SupabaseTestDumpKey123 + diff --git a/nix/config.nix b/nix/config.nix index 267ec18a8..4076f0cea 100644 --- a/nix/config.nix +++ b/nix/config.nix @@ -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 = { diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in index 8fa266fce..934724c03 100644 --- a/nix/tools/dbmate-tool.sh.in +++ b/nix/tools/dbmate-tool.sh.in @@ -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 @@ -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"