chore: remove `ALTER TYPE .. ADD VALUE` from migration 65 (#10998)

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

View File

@ -1,4 +1,28 @@
ALTER TYPE audit_action ADD VALUE IF NOT EXISTS 'start';
ALTER TYPE audit_action ADD VALUE IF NOT EXISTS 'stop';
CREATE TYPE new_audit_action AS ENUM (
'create',
'write',
'delete',
'start',
'stop'
);
ALTER TYPE resource_type ADD VALUE IF NOT EXISTS 'workspace_build';
CREATE TYPE new_resource_type AS ENUM (
'organization',
'template',
'template_version',
'user',
'workspace',
'git_ssh_key',
'api_key',
'group',
'workspace_build'
);
ALTER TABLE audit_logs
ALTER COLUMN action TYPE new_audit_action USING (action::text::new_audit_action),
ALTER COLUMN resource_type TYPE new_resource_type USING (resource_type::text::new_resource_type);
DROP TYPE audit_action;
ALTER TYPE new_audit_action RENAME TO audit_action;
DROP TYPE resource_type;
ALTER TYPE new_resource_type RENAME TO resource_type;