Skip to content

Commit

Permalink
Native repo SQL cleanup for correlation, change #9 was modified.
Browse files Browse the repository at this point in the history
Change #9 in upgrade script was not published yet, so we could "rebase"
the changes.
  • Loading branch information
virgo47 committed Sep 13, 2022
1 parent e75dc84 commit 49ae9d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
15 changes: 3 additions & 12 deletions config/sql/native-new/postgres-new-upgrade.sql
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,15 @@ CREATE TABLE m_focus_identity (
CHECK (containerType = 'FOCUS_IDENTITY'),
fullObject BYTEA,
sourceResourceRefTargetOid UUID,
itemsOriginal JSONB,
itemsNormalized JSONB,

PRIMARY KEY (ownerOid, cid)
)
INHERITS(m_container);

CREATE INDEX m_focus_identity_sourceResourceRefTargetOid_idx ON m_focus_identity (sourceResourceRefTargetOid);
CREATE INDEX m_focus_identity_itemsOriginal_idx ON m_focus_identity USING gin(itemsOriginal);
CREATE INDEX m_focus_identity_itemsNormalized_idx ON m_focus_identity USING gin(itemsNormalized);

ALTER TABLE m_focus ADD normalizedData JSONB;
CREATE INDEX m_focus_normalizedData_idx ON m_focus USING gin(normalizedData);
$aa$);

-- resource templates
Expand All @@ -163,14 +162,6 @@ call apply_change(11, $aa$
ALTER TABLE m_connector ADD available BOOLEAN;
$aa$);

-- Simplifying/finalizing database schema for smart correlation
-- TODO what about removing obsolete "items original and normalized"?
-- Should we squash changes 9 and 12 into a clean one?
call apply_change(12, $aa$
ALTER TABLE m_object ADD normalizedData JSONB;
CREATE INDEX m_object_normalized_data_idx ON m_object USING gin(normalizedData);
$aa$);

-- SCHEMA-COMMIT 4.6: commit TODO

-- WRITE CHANGES ABOVE ^^
Expand Down
2 changes: 0 additions & 2 deletions config/sql/native-new/postgres-new.sql
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,6 @@ CREATE TABLE m_focus_identity (
INHERITS(m_container);

CREATE INDEX m_focus_identity_sourceResourceRefTargetOid_idx ON m_focus_identity (sourceResourceRefTargetOid);
CREATE INDEX m_focus_identity_itemsOriginal_idx ON m_focus_identity USING gin(itemsOriginal);
CREATE INDEX m_focus_identity_itemsNormalized_idx ON m_focus_identity USING gin(itemsNormalized);

-- Represents GenericObjectType, see https://docs.evolveum.com/midpoint/reference/schema/generic-objects/
CREATE TABLE m_generic_object (
Expand Down

0 comments on commit 49ae9d8

Please sign in to comment.