From c144b3d0d39f1d085a5d862612f11873c4d7233b Mon Sep 17 00:00:00 2001 From: geethkokila Date: Tue, 4 Sep 2018 11:04:26 +0530 Subject: [PATCH] Update the migration script --- .../cdm-migration.sql | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/migration/migration-emm_2.1.0-to-iot_3.3.1/cdm-migration.sql b/modules/migration/migration-emm_2.1.0-to-iot_3.3.1/cdm-migration.sql index 5012472d..5a54d7d4 100644 --- a/modules/migration/migration-emm_2.1.0-to-iot_3.3.1/cdm-migration.sql +++ b/modules/migration/migration-emm_2.1.0-to-iot_3.3.1/cdm-migration.sql @@ -1,3 +1,13 @@ +-- Before running this script, please make sure that DM_OPERATION does have the INITIATED_BY column. Some customers +-- may have it because of a patch. But Some customers may not have it, therefore depending on the situation, please +-- comment or uncomment one of first two ALTER TABLE DM_OPERATION SQL commands. + +-- ALTER TABLE DM_OPERATION +-- ADD COLUMN INITIATED_BY VARCHAR(100) NULL DEFAULT NULL AFTER OPERATION_CODE; + +ALTER TABLE DM_OPERATION +CHANGE COLUMN INITIATED_BY INITIATED_BY VARCHAR(100) NULL DEFAULT NULL; + ALTER TABLE DM_PROFILE DROP FOREIGN KEY DM_PROFILE_DEVICE_TYPE; @@ -66,8 +76,7 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_GROUP_MAP ( ) ENGINE = InnoDB; -ALTER TABLE DM_OPERATION -CHANGE COLUMN INITIATED_BY INITIATED_BY VARCHAR(100) NULL DEFAULT NULL; + CREATE INDEX IDX_ENROLMENT_DEVICE_ID_TENANT_ID_STATUS ON DM_ENROLMENT(DEVICE_ID, TENANT_ID, STATUS);