Skip to content

Commit

Permalink
Merge branch 'master' into feature/auto-scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Aug 19, 2021
2 parents 98199d8 + e0a36cf commit 218bccc
Show file tree
Hide file tree
Showing 264 changed files with 7,804 additions and 7,156 deletions.
73 changes: 73 additions & 0 deletions config/sql/h2-upgrade-4.0-4.4.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
-- 2020-05-29 09:20

CREATE INDEX iOpExecTimestampValue
ON m_operation_execution (timestampValue);

UPDATE m_global_metadata SET value = '4.2' WHERE name = 'databaseSchemaVersion';

-- 2020-06-25 11:35

ALTER TABLE m_acc_cert_campaign ALTER COLUMN definitionRef_type RENAME TO definitionRef_targetType;
ALTER TABLE m_acc_cert_campaign ALTER COLUMN ownerRef_type RENAME TO ownerRef_targetType;
ALTER TABLE m_acc_cert_definition ALTER COLUMN ownerRef_type RENAME TO ownerRef_targetType;
ALTER TABLE m_connector ALTER COLUMN connectorHostRef_type RENAME TO connectorHostRef_targetType;
ALTER TABLE m_object ALTER COLUMN creatorRef_type RENAME TO creatorRef_targetType;
ALTER TABLE m_object ALTER COLUMN modifierRef_type RENAME TO modifierRef_targetType;
ALTER TABLE m_object ALTER COLUMN tenantRef_type RENAME TO tenantRef_targetType;
ALTER TABLE m_report_output ALTER COLUMN reportRef_type RENAME TO reportRef_targetType;
ALTER TABLE m_resource ALTER COLUMN connectorRef_type RENAME TO connectorRef_targetType;
ALTER TABLE m_shadow ALTER COLUMN resourceRef_type RENAME TO resourceRef_targetType;
ALTER TABLE m_acc_cert_case ALTER COLUMN objectRef_type RENAME TO objectRef_targetType;
ALTER TABLE m_acc_cert_case ALTER COLUMN orgRef_type RENAME TO orgRef_targetType;
ALTER TABLE m_acc_cert_case ALTER COLUMN targetRef_type RENAME TO targetRef_targetType;
ALTER TABLE m_acc_cert_case ALTER COLUMN tenantRef_type RENAME TO tenantRef_targetType;
ALTER TABLE m_acc_cert_wi ALTER COLUMN performerRef_type RENAME TO performerRef_targetType;
ALTER TABLE m_assignment ALTER COLUMN creatorRef_type RENAME TO creatorRef_targetType;
ALTER TABLE m_assignment ALTER COLUMN modifierRef_type RENAME TO modifierRef_targetType;
ALTER TABLE m_assignment ALTER COLUMN orgRef_type RENAME TO orgRef_targetType;
ALTER TABLE m_assignment ALTER COLUMN resourceRef_type RENAME TO resourceRef_targetType;
ALTER TABLE m_assignment ALTER COLUMN targetRef_type RENAME TO targetRef_targetType;
ALTER TABLE m_assignment ALTER COLUMN tenantRef_type RENAME TO tenantRef_targetType;
ALTER TABLE m_case_wi ALTER COLUMN originalAssigneeRef_type RENAME TO originalAssigneeRef_targetType;
ALTER TABLE m_case_wi ALTER COLUMN performerRef_type RENAME TO performerRef_targetType;
ALTER TABLE m_operation_execution ALTER COLUMN initiatorRef_type RENAME TO initiatorRef_targetType;
ALTER TABLE m_operation_execution ALTER COLUMN taskRef_type RENAME TO taskRef_targetType;
ALTER TABLE m_task ALTER COLUMN objectRef_type RENAME TO objectRef_targetType;
ALTER TABLE m_task ALTER COLUMN ownerRef_type RENAME TO ownerRef_targetType;
ALTER TABLE m_abstract_role ALTER COLUMN ownerRef_type RENAME TO ownerRef_targetType;
ALTER TABLE m_case ALTER COLUMN objectRef_type RENAME TO objectRef_targetType;
ALTER TABLE m_case ALTER COLUMN parentRef_type RENAME TO parentRef_targetType;
ALTER TABLE m_case ALTER COLUMN requestorRef_type RENAME TO requestorRef_targetType;
ALTER TABLE m_case ALTER COLUMN targetRef_type RENAME TO targetRef_targetType;

-- 2020-08-19 10:55

ALTER TABLE m_focus ADD COLUMN passwordCreateTimestamp TIMESTAMP;
ALTER TABLE m_focus ADD COLUMN passwordModifyTimestamp TIMESTAMP;

-- MID-6037
ALTER TABLE m_service ADD CONSTRAINT uc_service_name UNIQUE (name_norm);

-- MID-6232
CREATE INDEX iAuditEventRecordEStageTOid
ON m_audit_event (eventStage, targetOid);

-- policySituation belong to M_OBJECT
ALTER TABLE m_focus_policy_situation DROP CONSTRAINT fk_focus_policy_situation;
ALTER TABLE m_focus_policy_situation RENAME TO m_object_policy_situation;
ALTER TABLE m_object_policy_situation ALTER COLUMN focus_oid RENAME TO object_oid;
ALTER TABLE m_object_policy_situation
ADD CONSTRAINT fk_object_policy_situation FOREIGN KEY (object_oid) REFERENCES m_object;

COMMIT;

-- 4.3+ Changes

-- MID-6417
ALTER TABLE m_operation_execution ADD COLUMN recordType INTEGER;

-- MID-3669
ALTER TABLE m_focus ADD COLUMN lockoutStatus INTEGER;

-- WRITE CHANGES ABOVE ^^
UPDATE m_global_metadata SET value = '4.3' WHERE name = 'databaseSchemaVersion';
77 changes: 77 additions & 0 deletions config/sql/mysql-upgrade-4.0-4.4-utf8mb4.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
-- 2020-05-29 09:20

CREATE INDEX iOpExecTimestampValue
ON m_operation_execution (timestampValue);

UPDATE m_global_metadata SET value = '4.2' WHERE name = 'databaseSchemaVersion';

-- 2020-06-25 11:35

ALTER TABLE m_acc_cert_campaign CHANGE definitionRef_type definitionRef_targetType INTEGER;
ALTER TABLE m_acc_cert_campaign CHANGE ownerRef_type ownerRef_targetType INTEGER;
ALTER TABLE m_acc_cert_definition CHANGE ownerRef_type ownerRef_targetType INTEGER;
ALTER TABLE m_connector CHANGE connectorHostRef_type connectorHostRef_targetType INTEGER;
ALTER TABLE m_object CHANGE creatorRef_type creatorRef_targetType INTEGER;
ALTER TABLE m_object CHANGE modifierRef_type modifierRef_targetType INTEGER;
ALTER TABLE m_object CHANGE tenantRef_type tenantRef_targetType INTEGER;
ALTER TABLE m_report_output CHANGE reportRef_type reportRef_targetType INTEGER;
ALTER TABLE m_resource CHANGE connectorRef_type connectorRef_targetType INTEGER;
ALTER TABLE m_shadow CHANGE resourceRef_type resourceRef_targetType INTEGER;
ALTER TABLE m_acc_cert_case CHANGE objectRef_type objectRef_targetType INTEGER;
ALTER TABLE m_acc_cert_case CHANGE orgRef_type orgRef_targetType INTEGER;
ALTER TABLE m_acc_cert_case CHANGE targetRef_type targetRef_targetType INTEGER;
ALTER TABLE m_acc_cert_case CHANGE tenantRef_type tenantRef_targetType INTEGER;
ALTER TABLE m_acc_cert_wi CHANGE performerRef_type performerRef_targetType INTEGER;
ALTER TABLE m_assignment CHANGE creatorRef_type creatorRef_targetType INTEGER;
ALTER TABLE m_assignment CHANGE modifierRef_type modifierRef_targetType INTEGER;
ALTER TABLE m_assignment CHANGE orgRef_type orgRef_targetType INTEGER;
ALTER TABLE m_assignment CHANGE resourceRef_type resourceRef_targetType INTEGER;
ALTER TABLE m_assignment CHANGE targetRef_type targetRef_targetType INTEGER;
ALTER TABLE m_assignment CHANGE tenantRef_type tenantRef_targetType INTEGER;
ALTER TABLE m_case_wi CHANGE originalAssigneeRef_type originalAssigneeRef_targetType INTEGER;
ALTER TABLE m_case_wi CHANGE performerRef_type performerRef_targetType INTEGER;
ALTER TABLE m_operation_execution CHANGE initiatorRef_type initiatorRef_targetType INTEGER;
ALTER TABLE m_operation_execution CHANGE taskRef_type taskRef_targetType INTEGER;
ALTER TABLE m_task CHANGE objectRef_type objectRef_targetType INTEGER;
ALTER TABLE m_task CHANGE ownerRef_type ownerRef_targetType INTEGER;
ALTER TABLE m_abstract_role CHANGE ownerRef_type ownerRef_targetType INTEGER;
ALTER TABLE m_case CHANGE objectRef_type objectRef_targetType INTEGER;
ALTER TABLE m_case CHANGE parentRef_type parentRef_targetType INTEGER;
ALTER TABLE m_case CHANGE requestorRef_type requestorRef_targetType INTEGER;
ALTER TABLE m_case CHANGE targetRef_type targetRef_targetType INTEGER;

-- 2020-08-19 10:55

ALTER TABLE m_focus ADD COLUMN passwordCreateTimestamp DATETIME(6);
ALTER TABLE m_focus ADD COLUMN passwordModifyTimestamp DATETIME(6);

-- MID-6037
ALTER TABLE m_service ADD CONSTRAINT uc_service_name UNIQUE (name_norm);

-- MID-6232
CREATE INDEX iAuditEventRecordEStageTOid
ON m_audit_event (eventStage, targetOid);

-- policySituation belong to M_OBJECT
ALTER TABLE m_focus_policy_situation DROP FOREIGN KEY fk_focus_policy_situation;
ALTER TABLE m_focus_policy_situation RENAME TO m_object_policy_situation;
ALTER TABLE m_object_policy_situation CHANGE COLUMN focus_oid object_oid VARCHAR(36) CHARSET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE m_object_policy_situation
ADD CONSTRAINT fk_object_policy_situation FOREIGN KEY (object_oid) REFERENCES m_object (oid);

COMMIT;
-- 4.3+ Changes
-- MID-6417
ALTER TABLE m_operation_execution ADD COLUMN recordType INTEGER;

-- MID-3669
ALTER TABLE m_focus ADD COLUMN lockoutStatus INTEGER;

-- WRITE CHANGES ABOVE ^^
UPDATE m_global_metadata SET value = '4.3' WHERE name = 'databaseSchemaVersion';

-- MID-6974
UPDATE QRTZ_JOB_DETAILS SET job_class_name = 'com.evolveum.midpoint.task.quartzimpl.run.JobExecutor'
WHERE job_class_name = 'com.evolveum.midpoint.task.quartzimpl.execution.JobExecutor';

COMMIT;
79 changes: 79 additions & 0 deletions config/sql/mysql-upgrade-4.0-4.4.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
-- 2020-05-29 09:20

CREATE INDEX iOpExecTimestampValue
ON m_operation_execution (timestampValue);

UPDATE m_global_metadata SET value = '4.2' WHERE name = 'databaseSchemaVersion';

-- 2020-06-25 11:35

ALTER TABLE m_acc_cert_campaign CHANGE definitionRef_type definitionRef_targetType INTEGER;
ALTER TABLE m_acc_cert_campaign CHANGE ownerRef_type ownerRef_targetType INTEGER;
ALTER TABLE m_acc_cert_definition CHANGE ownerRef_type ownerRef_targetType INTEGER;
ALTER TABLE m_connector CHANGE connectorHostRef_type connectorHostRef_targetType INTEGER;
ALTER TABLE m_object CHANGE creatorRef_type creatorRef_targetType INTEGER;
ALTER TABLE m_object CHANGE modifierRef_type modifierRef_targetType INTEGER;
ALTER TABLE m_object CHANGE tenantRef_type tenantRef_targetType INTEGER;
ALTER TABLE m_report_output CHANGE reportRef_type reportRef_targetType INTEGER;
ALTER TABLE m_resource CHANGE connectorRef_type connectorRef_targetType INTEGER;
ALTER TABLE m_shadow CHANGE resourceRef_type resourceRef_targetType INTEGER;
ALTER TABLE m_acc_cert_case CHANGE objectRef_type objectRef_targetType INTEGER;
ALTER TABLE m_acc_cert_case CHANGE orgRef_type orgRef_targetType INTEGER;
ALTER TABLE m_acc_cert_case CHANGE targetRef_type targetRef_targetType INTEGER;
ALTER TABLE m_acc_cert_case CHANGE tenantRef_type tenantRef_targetType INTEGER;
ALTER TABLE m_acc_cert_wi CHANGE performerRef_type performerRef_targetType INTEGER;
ALTER TABLE m_assignment CHANGE creatorRef_type creatorRef_targetType INTEGER;
ALTER TABLE m_assignment CHANGE modifierRef_type modifierRef_targetType INTEGER;
ALTER TABLE m_assignment CHANGE orgRef_type orgRef_targetType INTEGER;
ALTER TABLE m_assignment CHANGE resourceRef_type resourceRef_targetType INTEGER;
ALTER TABLE m_assignment CHANGE targetRef_type targetRef_targetType INTEGER;
ALTER TABLE m_assignment CHANGE tenantRef_type tenantRef_targetType INTEGER;
ALTER TABLE m_case_wi CHANGE originalAssigneeRef_type originalAssigneeRef_targetType INTEGER;
ALTER TABLE m_case_wi CHANGE performerRef_type performerRef_targetType INTEGER;
ALTER TABLE m_operation_execution CHANGE initiatorRef_type initiatorRef_targetType INTEGER;
ALTER TABLE m_operation_execution CHANGE taskRef_type taskRef_targetType INTEGER;
ALTER TABLE m_task CHANGE objectRef_type objectRef_targetType INTEGER;
ALTER TABLE m_task CHANGE ownerRef_type ownerRef_targetType INTEGER;
ALTER TABLE m_abstract_role CHANGE ownerRef_type ownerRef_targetType INTEGER;
ALTER TABLE m_case CHANGE objectRef_type objectRef_targetType INTEGER;
ALTER TABLE m_case CHANGE parentRef_type parentRef_targetType INTEGER;
ALTER TABLE m_case CHANGE requestorRef_type requestorRef_targetType INTEGER;
ALTER TABLE m_case CHANGE targetRef_type targetRef_targetType INTEGER;

-- 2020-08-19 10:55

ALTER TABLE m_focus ADD COLUMN passwordCreateTimestamp DATETIME(6);
ALTER TABLE m_focus ADD COLUMN passwordModifyTimestamp DATETIME(6);

-- MID-6037
ALTER TABLE m_service ADD CONSTRAINT uc_service_name UNIQUE (name_norm);

-- MID-6232
CREATE INDEX iAuditEventRecordEStageTOid
ON m_audit_event (eventStage, targetOid);

-- policySituation belong to M_OBJECT
ALTER TABLE m_focus_policy_situation DROP FOREIGN KEY fk_focus_policy_situation;
ALTER TABLE m_focus_policy_situation RENAME TO m_object_policy_situation;
ALTER TABLE m_object_policy_situation CHANGE COLUMN focus_oid object_oid VARCHAR(36) NOT NULL;
-- If there are problems with these statements (e.g. Foreign key constraint is incorrectly formed),
-- try dropping the table m_object_policy_situation and recreating it, then add this FK again.
ALTER TABLE m_object_policy_situation
ADD CONSTRAINT fk_object_policy_situation FOREIGN KEY (object_oid) REFERENCES m_object (oid);

COMMIT;
-- 4.3+ Changes
-- MID-6417
ALTER TABLE m_operation_execution ADD COLUMN recordType INTEGER;

-- MID-3669
ALTER TABLE m_focus ADD COLUMN lockoutStatus INTEGER;

-- WRITE CHANGES ABOVE ^^
UPDATE m_global_metadata SET value = '4.3' WHERE name = 'databaseSchemaVersion';

-- MID-6974
UPDATE QRTZ_JOB_DETAILS SET job_class_name = 'com.evolveum.midpoint.task.quartzimpl.run.JobExecutor'
WHERE job_class_name = 'com.evolveum.midpoint.task.quartzimpl.execution.JobExecutor';

COMMIT;
79 changes: 79 additions & 0 deletions config/sql/oracle-upgrade-4.0-4.4.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
-- 2020-05-29 09:20

CREATE INDEX iOpExecTimestampValue
ON m_operation_execution (timestampValue) INITRANS 30;

UPDATE m_global_metadata SET value = '4.2' WHERE name = 'databaseSchemaVersion';

-- 2020-06-25 11:35

ALTER TABLE m_acc_cert_campaign RENAME COLUMN definitionRef_type TO definitionRef_targetType;
ALTER TABLE m_acc_cert_campaign RENAME COLUMN ownerRef_type TO ownerRef_targetType;
ALTER TABLE m_acc_cert_definition RENAME COLUMN ownerRef_type TO ownerRef_targetType;
ALTER TABLE m_connector RENAME COLUMN connectorHostRef_type TO connectorHostRef_targetType;
ALTER TABLE m_object RENAME COLUMN creatorRef_type TO creatorRef_targetType;
ALTER TABLE m_object RENAME COLUMN modifierRef_type TO modifierRef_targetType;
ALTER TABLE m_object RENAME COLUMN tenantRef_type TO tenantRef_targetType;
ALTER TABLE m_report_output RENAME COLUMN reportRef_type TO reportRef_targetType;
ALTER TABLE m_resource RENAME COLUMN connectorRef_type TO connectorRef_targetType;
ALTER TABLE m_shadow RENAME COLUMN resourceRef_type TO resourceRef_targetType;
ALTER TABLE m_acc_cert_case RENAME COLUMN objectRef_type TO objectRef_targetType;
ALTER TABLE m_acc_cert_case RENAME COLUMN orgRef_type TO orgRef_targetType;
ALTER TABLE m_acc_cert_case RENAME COLUMN targetRef_type TO targetRef_targetType;
ALTER TABLE m_acc_cert_case RENAME COLUMN tenantRef_type TO tenantRef_targetType;
ALTER TABLE m_acc_cert_wi RENAME COLUMN performerRef_type TO performerRef_targetType;
ALTER TABLE m_assignment RENAME COLUMN creatorRef_type TO creatorRef_targetType;
ALTER TABLE m_assignment RENAME COLUMN modifierRef_type TO modifierRef_targetType;
ALTER TABLE m_assignment RENAME COLUMN orgRef_type TO orgRef_targetType;
ALTER TABLE m_assignment RENAME COLUMN resourceRef_type TO resourceRef_targetType;
ALTER TABLE m_assignment RENAME COLUMN targetRef_type TO targetRef_targetType;
ALTER TABLE m_assignment RENAME COLUMN tenantRef_type TO tenantRef_targetType;
ALTER TABLE m_case_wi RENAME COLUMN originalAssigneeRef_type TO originalAssigneeRef_targetType;
ALTER TABLE m_case_wi RENAME COLUMN performerRef_type TO performerRef_targetType;
ALTER TABLE m_operation_execution RENAME COLUMN initiatorRef_type TO initiatorRef_targetType;
ALTER TABLE m_operation_execution RENAME COLUMN taskRef_type TO taskRef_targetType;
ALTER TABLE m_task RENAME COLUMN objectRef_type TO objectRef_targetType;
ALTER TABLE m_task RENAME COLUMN ownerRef_type TO ownerRef_targetType;
ALTER TABLE m_abstract_role RENAME COLUMN ownerRef_type TO ownerRef_targetType;
ALTER TABLE m_case RENAME COLUMN objectRef_type TO objectRef_targetType;
ALTER TABLE m_case RENAME COLUMN parentRef_type TO parentRef_targetType;
ALTER TABLE m_case RENAME COLUMN requestorRef_type TO requestorRef_targetType;
ALTER TABLE m_case RENAME COLUMN targetRef_type TO targetRef_targetType;

-- 2020-08-19 10:55

ALTER TABLE m_focus ADD passwordCreateTimestamp TIMESTAMP;
ALTER TABLE m_focus ADD passwordModifyTimestamp TIMESTAMP;

-- MID-6037
ALTER TABLE m_service ADD CONSTRAINT uc_service_name UNIQUE (name_norm);

-- MID-6232
CREATE INDEX iAuditEventRecordEStageTOid
ON m_audit_event (eventStage, targetOid) INITRANS 30;

-- policySituation belong to M_OBJECT
ALTER TABLE m_focus_policy_situation DROP CONSTRAINT fk_focus_policy_situation;
ALTER TABLE m_focus_policy_situation RENAME TO m_object_policy_situation;
ALTER TABLE m_object_policy_situation RENAME COLUMN focus_oid TO object_oid;
ALTER TABLE m_object_policy_situation
ADD CONSTRAINT fk_object_policy_situation FOREIGN KEY (object_oid) REFERENCES m_object;
ALTER INDEX iFocusPolicySituationOid RENAME TO iObjectPolicySituationOid;

COMMIT;

-- 4.3+ Changes
-- MID-6417
ALTER TABLE m_operation_execution ADD recordType NUMBER(10, 0);

-- MID-3669
ALTER TABLE m_focus ADD lockoutStatus NUMBER(10, 0);

-- WRITE CHANGES ABOVE ^^
UPDATE m_global_metadata SET value = '4.3' WHERE name = 'databaseSchemaVersion';

-- MID-6974
UPDATE qrtz_job_details SET job_class_name = 'com.evolveum.midpoint.task.quartzimpl.run.JobExecutor'
WHERE job_class_name = 'com.evolveum.midpoint.task.quartzimpl.execution.JobExecutor';

COMMIT;

0 comments on commit 218bccc

Please sign in to comment.