mirror of
https://github.com/coder/coder.git
synced 2025-07-21 01:28:49 +00:00
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:
@ -1,4 +1,28 @@
|
|||||||
ALTER TYPE audit_action ADD VALUE IF NOT EXISTS 'start';
|
CREATE TYPE new_audit_action AS ENUM (
|
||||||
ALTER TYPE audit_action ADD VALUE IF NOT EXISTS 'stop';
|
'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;
|
||||||
|
Reference in New Issue
Block a user