Add coredata entities for access review campaigns, access sources, access entries with decision history, campaign source fetches, and scope systems. Include migrations, entity type registrations, enum types for flags, decisions, MFA status, and auth methods. Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
32 lines
1.4 KiB
SQL
32 lines
1.4 KiB
SQL
-- Copyright (c) 2026 Probo Inc <hello@getprobo.com>.
|
|
--
|
|
-- Permission to use, copy, modify, and/or distribute this software for any
|
|
-- purpose with or without fee is hereby granted, provided that the above
|
|
-- copyright notice and this permission notice appear in all copies.
|
|
--
|
|
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
-- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
-- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
-- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
-- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
-- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
-- PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
-- Add description to campaigns and decision audit trail
|
|
|
|
-- 1. Campaign description
|
|
ALTER TABLE access_review_campaigns ADD COLUMN description TEXT NOT NULL DEFAULT '';
|
|
ALTER TABLE access_review_campaigns ALTER COLUMN description DROP DEFAULT;
|
|
|
|
-- 2. Decision audit trail: immutable log of every decision recorded
|
|
CREATE TABLE access_entry_decision_history (
|
|
id TEXT PRIMARY KEY,
|
|
tenant_id TEXT NOT NULL,
|
|
access_entry_id TEXT NOT NULL REFERENCES access_entries(id) ON DELETE CASCADE,
|
|
decision access_entry_decision NOT NULL,
|
|
decision_note TEXT,
|
|
decided_by TEXT,
|
|
decided_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
|
created_at TIMESTAMP WITH TIME ZONE NOT NULL
|
|
);
|