We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ALTER TYPE .. ADD VALUE
1 parent 4275721 commit cbcf756Copy full SHA for cbcf756
coderd/database/migrations/000046_more_resource_types.up.sql
@@ -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';
+CREATE TYPE new_resource_type AS ENUM (
+ '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