Skip to content

Commit

Permalink
Update native repo schema wrt associations
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Apr 19, 2024
1 parent 2896695 commit cdea787
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions config/sql/native/postgres-upgrade.sql
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,11 @@ CREATE TRIGGER m_schema_oid_delete_tr AFTER DELETE ON m_schema

$aa$);

-- associations (maybe temporary)
call apply_change(31, $aa$
ALTER TYPE ShadowKindType ADD VALUE IF NOT EXISTS 'ASSOCIATED' AFTER 'GENERIC';
$aa$);

---
-- WRITE CHANGES ABOVE ^^
-- IMPORTANT: update apply_change number at the end of postgres-new.sql
Expand Down
5 changes: 3 additions & 2 deletions config/sql/native/postgres.sql
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ CREATE TYPE PredefinedConfigurationType AS ENUM ( 'PRODUCTION', 'DEVELOPMENT' );

CREATE TYPE ResourceAdministrativeStateType AS ENUM ('ENABLED', 'DISABLED');

CREATE TYPE ShadowKindType AS ENUM ('ACCOUNT', 'ENTITLEMENT', 'GENERIC', 'UNKNOWN');
-- ASSOCIATED is maybe temporary
CREATE TYPE ShadowKindType AS ENUM ('ACCOUNT', 'ENTITLEMENT', 'GENERIC', 'ASSOCIATED', 'UNKNOWN');

CREATE TYPE SynchronizationSituationType AS ENUM (
'DELETED', 'DISPUTED', 'LINKED', 'UNLINKED', 'UNMATCHED');
Expand Down Expand Up @@ -2270,4 +2271,4 @@ END $$;
-- This is important to avoid applying any change more than once.
-- Also update SqaleUtils.CURRENT_SCHEMA_CHANGE_NUMBER
-- repo/repo-sqale/src/main/java/com/evolveum/midpoint/repo/sqale/SqaleUtils.java
call apply_change(28, $$ SELECT 1 $$, true);
call apply_change(31, $$ SELECT 1 $$, true);
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class SqaleUtils {
*/
public static final String SCHEMA_AUDIT_CHANGE_NUMBER = "schemaAuditChangeNumber";

public static final int CURRENT_SCHEMA_CHANGE_NUMBER = 30;
public static final int CURRENT_SCHEMA_CHANGE_NUMBER = 31;

public static final int CURRENT_SCHEMA_AUDIT_CHANGE_NUMBER = 9;

Expand Down

0 comments on commit cdea787

Please sign in to comment.