Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BED-4363 fix: missing constraint on roles #809

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions cmd/api/src/database/migration/migrations/v5.15.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@
--
-- SPDX-License-Identifier: Apache-2.0

-- Add unique constraint to roles table
ALTER TABLE IF EXISTS roles
DROP CONSTRAINT IF EXISTS roles_name_key;
ALTER TABLE IF EXISTS roles
ADD CONSTRAINT roles_name_key UNIQUE (name);

-- Add unique constraint to permissions table
ALTER TABLE IF EXISTS permissions
DROP CONSTRAINT IF EXISTS permissions_authority_name_key;
ALTER TABLE IF EXISTS permissions
ADD CONSTRAINT permissions_authority_name_key UNIQUE (authority, name);

-- Feature Flags
INSERT INTO feature_flags (created_at, updated_at, key, name, description, enabled, user_updatable) VALUES (current_timestamp, current_timestamp, 'adcs', 'Enable collection and processing of Active Directory Certificate Services Data', 'Enables the ability to collect, analyze, and explore Active Directory Certificate Services data and previews new attack paths.', false, true) ON CONFLICT DO NOTHING;
INSERT INTO feature_flags (created_at, updated_at, key, name, description, enabled, user_updatable) VALUES (current_timestamp, current_timestamp, 'clear_graph_data', 'Clear Graph Data', 'Enables the ability to delete all nodes and edges from the graph database.', true, false) ON CONFLICT DO NOTHING;
Expand Down
Loading