Skip to content

Commit 49ed66c

Browse files
authored
chore: remove ALTER TYPE .. ADD VALUE from migration 65 (#10998)
Follow up of Follow up of #10966
1 parent cbcf756 commit 49ed66c

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed
Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
1-
ALTER TYPE audit_action ADD VALUE IF NOT EXISTS 'start';
2-
ALTER TYPE audit_action ADD VALUE IF NOT EXISTS 'stop';
1+
CREATE TYPE new_audit_action AS ENUM (
2+
'create',
3+
'write',
4+
'delete',
5+
'start',
6+
'stop'
7+
);
38

4-
ALTER TYPE resource_type ADD VALUE IF NOT EXISTS 'workspace_build';
9+
CREATE TYPE new_resource_type AS ENUM (
10+
'organization',
11+
'template',
12+
'template_version',
13+
'user',
14+
'workspace',
15+
'git_ssh_key',
16+
'api_key',
17+
'group',
18+
'workspace_build'
19+
);
20+
21+
ALTER TABLE audit_logs
22+
ALTER COLUMN action TYPE new_audit_action USING (action::text::new_audit_action),
23+
ALTER COLUMN resource_type TYPE new_resource_type USING (resource_type::text::new_resource_type);
24+
25+
DROP TYPE audit_action;
26+
ALTER TYPE new_audit_action RENAME TO audit_action;
27+
DROP TYPE resource_type;
28+
ALTER TYPE new_resource_type RENAME TO resource_type;

0 commit comments

Comments
 (0)