-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrevert.sql
More file actions
17 lines (13 loc) · 750 Bytes
/
Copy pathrevert.sql
File metadata and controls
17 lines (13 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
-- Tears down everything the migrations created. Destructive.
-- Migration history rows are deleted by the revert scripts, not here.
-- pgmq extension takes the queues and their tables with it
drop extension if exists pgmq cascade;
drop schema if exists librebeats cascade;
-- listener user, identities go via fk cascade
delete from auth.users where email = 'listner@librebeats.com';
-- objects first, buckets reference them. newer storage versions block direct deletes
-- behind this setting, older ones just ignore it
set storage.allow_delete_query = 'true';
delete from storage.objects where bucket_id in ('audio-files', 'image-files');
delete from storage.buckets where id in ('audio-files', 'image-files');
reset storage.allow_delete_query;