mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix(coderd/database): allow same custom role name for different orgs (#21312)
Previously the `idx_custom_roles_name_lower` index prevented that. A check constraint was also added to ensure the `organization_id` column cannot be set to the all-zero UUID.
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
-- Fixture for migration 000404_allow_same_role_name_in_different_orgs.
|
||||
-- Inserts a custom role with an all-zero organization_id to ensure the
|
||||
-- migration correctly normalizes such values.
|
||||
INSERT INTO custom_roles (name, display_name, organization_id)
|
||||
VALUES (
|
||||
'custom-role-zero-org-id',
|
||||
'Custom Role (Zero Org ID)',
|
||||
'00000000-0000-0000-0000-000000000000'::uuid
|
||||
)
|
||||
ON CONFLICT DO NOTHING;
|
||||
Reference in New Issue
Block a user