Skip to content

Commit

Permalink
Native repo/simul.: added missing object types for audit schema as well
Browse files Browse the repository at this point in the history
Without it separate audit DB complains a lot.
  • Loading branch information
virgo47 committed Jan 28, 2023
1 parent 664a137 commit eddcb88
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 4 additions & 2 deletions config/sql/native-new/postgres-new-audit.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2022 Evolveum and contributors
* Copyright (C) 2010-2023 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
Expand Down Expand Up @@ -60,7 +60,9 @@ DO $$ BEGIN
'SEQUENCE',
'SERVICE',
'SHADOW',
'SIMULATION_RESULT',
'SYSTEM_CONFIGURATION',
'TAG',
'TASK',
'USER',
'VALUE_POLICY');
Expand Down Expand Up @@ -340,4 +342,4 @@ limit 50;

-- Initializing the last change number used in postgres-new-upgrade.sql.
-- This is important to avoid applying any change more than once.
call apply_audit_change(2, $$ SELECT 1 $$, true);
call apply_audit_change(3, $$ SELECT 1 $$, true);
7 changes: 6 additions & 1 deletion config/sql/native-new/postgres-new-upgrade-audit.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2022 Evolveum and contributors
* Copyright (C) 2010-2023 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
Expand Down Expand Up @@ -103,6 +103,11 @@ $aa$);
-- SCHEMA-COMMIT 4.6: commit 71f2df50

-- changes for 4.7
-- Simulation related changes
call apply_audit_change(3, $aa$
ALTER TYPE ObjectType ADD VALUE IF NOT EXISTS 'SIMULATION_RESULT' AFTER 'SHADOW';
ALTER TYPE ObjectType ADD VALUE IF NOT EXISTS 'TAG' AFTER 'SYSTEM_CONFIGURATION';
$aa$);

-- WRITE CHANGES ABOVE ^^
-- IMPORTANT: update apply_audit_change number at the end of postgres-new-audit.sql
Expand Down
4 changes: 2 additions & 2 deletions config/sql/native-new/postgres-new-upgrade.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2022 Evolveum and contributors
* Copyright (C) 2010-2023 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
Expand Down Expand Up @@ -175,7 +175,7 @@ call apply_change(12, $aa$
ALTER TYPE ObjectType ADD VALUE IF NOT EXISTS 'TAG' AFTER 'SYSTEM_CONFIGURATION';
ALTER TYPE ReferenceType ADD VALUE IF NOT EXISTS 'PROCESSED_OBJECT_EVENT_TAG' AFTER 'PROJECTION';
ALTER TYPE ContainerType ADD VALUE IF NOT EXISTS 'SIMULATION_RESULT_PROCESSED_OBJECT' AFTER 'OPERATION_EXECUTION';
$aa$);
$aa$, true); -- TODO remove forced before release

call apply_change(13, $aa$
-- TODO delete before release
Expand Down

0 comments on commit eddcb88

Please sign in to comment.