Skip to content
Open
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
1 change: 0 additions & 1 deletion pkg/migration/drop.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ var (
`\_realtime`,
`\_supavisor`,
"pgbouncer",
"pgmq",
"pgsodium",
"pgtle",
`supabase\_migrations`,
Expand Down
2 changes: 1 addition & 1 deletion pkg/migration/queries/drop.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ begin
from pg_namespace pn
left join pg_depend pd on pd.objid = pn.oid
where pd.deptype is null
and not pn.nspname like any(array['information\_schema', 'pg\_%', '\_analytics', '\_realtime', '\_supavisor', 'pgbouncer', 'pgmq', 'pgsodium', 'pgtle', 'supabase\_migrations', 'vault', 'extensions', 'public'])
and not pn.nspname like any(array['information\_schema', 'pg\_%', '\_analytics', '\_realtime', '\_supavisor', 'pgbouncer', 'pgsodium', 'pgtle', 'supabase\_migrations', 'vault', 'extensions', 'public'])
and pn.nspowner::regrole::text != 'supabase_admin'
loop
-- If an extension uses a schema it doesn't create, dropping the schema will cascade to also
Expand Down
2 changes: 1 addition & 1 deletion pkg/migration/scripts/dump_schema.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pg_dump \
| sed -E "s/^REVOKE (.+) ON (.+) \"(${EXCLUDED_SCHEMAS:-})\"/-- &/" \
| sed -E 's/^(CREATE EXTENSION IF NOT EXISTS "pg_tle").+/\1;/' \
| sed -E 's/^(CREATE EXTENSION IF NOT EXISTS "pgsodium").+/\1;/' \
| sed -E 's/^(CREATE EXTENSION IF NOT EXISTS "pgmq").+/\1;/' \
| sed -E 's/^(CREATE EXTENSION IF NOT EXISTS "pgmq").+/CREATE SCHEMA IF NOT EXISTS "pgmq"; \1 WITH SCHEMA "pgmq";/' \
| sed -E 's/^COMMENT ON EXTENSION (.+)/-- &/' \
| sed -E 's/^CREATE POLICY "cron_job_/-- &/' \
| sed -E 's/^ALTER TABLE "cron"/-- &/' \
Expand Down
Loading