File tree 1 file changed +27
-3
lines changed
coderd/database/migrations 1 file changed +27
-3
lines changed Original file line number Diff line number Diff line change 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
+ );
3
8
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;
You can’t perform that action at this time.
0 commit comments