Skip to content

Commit 4025783

Browse files
committed
RHINENG-21445: fix drop of inventory schema
1 parent f9ccb0f commit 4025783

2 files changed

Lines changed: 4 additions & 56 deletions

File tree

database_admin/migrations/148_drop_inventory_schema.down.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
CREATE SCHEMA IF NOT EXISTS inventory;
22

3+
CREATE USER cyndi;
4+
35
-- The admin ROLE that allows the inventory schema to be managed
46
DO $$
57
BEGIN
Lines changed: 2 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,4 @@
1-
DO $$
2-
BEGIN
3-
REVOKE cyndi_reader FROM listener;
4-
EXCEPTION WHEN undefined_object THEN NULL;
5-
END
6-
$$;
7-
8-
DO $$
9-
BEGIN
10-
REVOKE cyndi_reader FROM evaluator;
11-
EXCEPTION WHEN undefined_object THEN NULL;
12-
END
13-
$$;
14-
15-
DO $$
16-
BEGIN
17-
REVOKE cyndi_reader FROM manager;
18-
EXCEPTION WHEN undefined_object THEN NULL;
19-
END
20-
$$;
21-
22-
DO $$
23-
BEGIN
24-
REVOKE cyndi_reader FROM vmaas_sync;
25-
EXCEPTION WHEN undefined_object THEN NULL;
26-
END
27-
$$;
28-
29-
DO $$
30-
BEGIN
31-
REVOKE cyndi_admin FROM cyndi;
32-
EXCEPTION WHEN undefined_object THEN NULL;
33-
END
34-
$$;
35-
36-
DO $$
37-
BEGIN
38-
IF EXISTS (SELECT 1 FROM pg_namespace WHERE nspname = 'inventory') THEN
39-
EXECUTE 'REVOKE ALL PRIVILEGES ON SCHEMA inventory FROM cyndi_admin';
40-
END IF;
41-
END
42-
$$;
43-
44-
DO $$
45-
BEGIN
46-
IF EXISTS (SELECT 1 FROM pg_namespace WHERE nspname = 'inventory') THEN
47-
EXECUTE 'REVOKE USAGE ON SCHEMA inventory FROM cyndi_reader';
48-
END IF;
49-
END
50-
$$;
51-
52-
DROP ROLE IF EXISTS cyndi_admin;
53-
54-
DROP ROLE IF EXISTS cyndi_reader;
55-
561
DROP SCHEMA IF EXISTS inventory CASCADE;
57-
582
DROP USER IF EXISTS cyndi;
3+
DROP ROLE IF EXISTS cyndi_reader;
4+
DROP ROLE IF EXISTS cyndi_admin;

0 commit comments

Comments
 (0)