chore: remove `ALTER TYPE .. ADD VALUE` from migration 46 (#10997)

Follow up of https://github.com/coder/coder/pull/10966
This commit is contained in:
Colin Adler 2023-12-02 11:38:12 -06:00 committed by GitHub
parent 427572199e
commit cbcf7561e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 2 deletions

View File

@ -1,2 +1,15 @@
ALTER TYPE resource_type ADD VALUE IF NOT EXISTS 'git_ssh_key';
ALTER TYPE resource_type ADD VALUE IF NOT EXISTS 'api_key';
CREATE TYPE new_resource_type AS ENUM (
'organization',
'template',
'template_version',
'user',
'workspace',
'git_ssh_key',
'api_key'
);
ALTER TABLE audit_logs
ALTER COLUMN resource_type TYPE new_resource_type USING(resource_type::text::new_resource_type);
DROP TYPE resource_type;
ALTER TYPE new_resource_type RENAME TO resource_type;