8000 fix: update migration · sorokinvld/postgres@5e09c64 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5e09c64

Browse files
committed
fix: update migration
`alter extension ... drop ...` is unnecessary with pgsodium v3.1.1
1 parent 2e9bea5 commit 5e09c64

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

migrations/db/migrations/20221207154255_create_pgsodium_and_vault.sql

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,6 @@ grant pgsodium_keyiduser to postgres with admin option;
66
grant pgsodium_keyholder to postgres with admin option;
77
grant pgsodium_keymaker to postgres with admin option;
88

9-
do $$
10-
begin
11-
if not exists (select from pg_extension where extname = 'supabase_vault') then
12-
create extension supabase_vault;
13-
-- Creating the extension creates a table and creates a security label on the table.
14-
-- Creating the security label triggers a function that recreates these objects.
15-
-- Since the recreation happens in an extension script, these objects become owned by the `supabase_vault` extension.
16-
-- This is an issue because then we can't recreate these objects without also dropping the extension.
17-
-- Thus we drop the dependency on the `supabase_vault` extension for these objects.
18-
alter extension supabase_vault drop view pgsodium.decrypted_key;
19-
alter extension supabase_vault drop function pgsodium.key_encrypt_secret;
20-
end if;
21-
end;
22-
$$;
9+
create extension if not exists supabase_vault;
2310

2411
-- migrate:down

0 commit comments

Comments
 (0)
0