mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
chore: implement audit log for custom role edits (#13494)
* chore: implement audit log for custom role edits
This commit is contained in:
@ -0,0 +1,2 @@
|
||||
DROP INDEX idx_custom_roles_id;
|
||||
ALTER TABLE custom_roles DROP COLUMN id;
|
@ -0,0 +1,8 @@
|
||||
-- (name) is the primary key, this column is almost exclusively for auditing.
|
||||
-- Audit logs require a uuid as the unique identifier for a resource.
|
||||
ALTER TABLE custom_roles ADD COLUMN id uuid DEFAULT gen_random_uuid() NOT NULL;
|
||||
COMMENT ON COLUMN custom_roles.id IS 'Custom roles ID is used purely for auditing purposes. Name is a better unique identifier.';
|
||||
|
||||
-- Ensure unique uuids.
|
||||
CREATE INDEX idx_custom_roles_id ON custom_roles (id);
|
||||
ALTER TYPE resource_type ADD VALUE IF NOT EXISTS 'custom_role';
|
Reference in New Issue
Block a user