Skip to content

Commit cbcf756

Browse files
authored
chore: remove ALTER TYPE .. ADD VALUE from migration 46 (#10997)
Follow up of #10966
1 parent 4275721 commit cbcf756

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed
Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
1-
ALTER TYPE resource_type ADD VALUE IF NOT EXISTS 'git_ssh_key';
2-
ALTER TYPE resource_type ADD VALUE IF NOT EXISTS 'api_key';
1+
CREATE TYPE new_resource_type AS ENUM (
2+
'organization',
3+
'template',
4+
'template_version',
5+
'user',
6+
'workspace',
7+
'git_ssh_key',
8+
'api_key'
9+
);
10+
11+
ALTER TABLE audit_logs
12+
ALTER COLUMN resource_type TYPE new_resource_type USING(resource_type::text::new_resource_type);
13+
14+
DROP TYPE resource_type;
15+
ALTER TYPE new_resource_type RENAME TO resource_type;

0 commit comments

Comments
 (0)