|
|
@ -1,4 +1,4 @@
|
|
|
|
use DM_DB530;
|
|
|
|
use bst_mdmdm_db;
|
|
|
|
|
|
|
|
|
|
|
|
-- iot 3.8.2 to iot 4.0.0 migration
|
|
|
|
-- iot 3.8.2 to iot 4.0.0 migration
|
|
|
|
ALTER TABLE DM_OPERATION
|
|
|
|
ALTER TABLE DM_OPERATION
|
|
|
@ -77,11 +77,11 @@ ALTER TABLE DM_OPERATION
|
|
|
|
ALTER COLUMN RECEIVED_TIMESTAMP BIGINT NULL;
|
|
|
|
ALTER COLUMN RECEIVED_TIMESTAMP BIGINT NULL;
|
|
|
|
|
|
|
|
|
|
|
|
-- Drop tables not in 5.3.0
|
|
|
|
-- Drop tables not in 5.3.0
|
|
|
|
DROP TABLE DM_CONFIG_OPERATION;
|
|
|
|
--DROP TABLE DM_CONFIG_OPERATION;
|
|
|
|
DROP TABLE DM_COMMAND_OPERATION;
|
|
|
|
--DROP TABLE DM_COMMAND_OPERATION;
|
|
|
|
DROP TABLE DM_POLICY_OPERATION;
|
|
|
|
--DROP TABLE DM_POLICY_OPERATION;
|
|
|
|
DROP TABLE DM_PROFILE_OPERATION;
|
|
|
|
--DROP TABLE DM_PROFILE_OPERATION;
|
|
|
|
DROP TABLE DM_DEVICE_APPLICATION_MAPPING;
|
|
|
|
--DROP TABLE DM_DEVICE_APPLICATION_MAPPING;
|
|
|
|
|
|
|
|
|
|
|
|
-- iot 4.0.0 to iot 4.1.0 migration
|
|
|
|
-- iot 4.0.0 to iot 4.1.0 migration
|
|
|
|
ALTER TABLE DM_POLICY
|
|
|
|
ALTER TABLE DM_POLICY
|
|
|
@ -361,3 +361,62 @@ CREATE TABLE DYNAMIC_TASK_PROPERTIES (
|
|
|
|
CONSTRAINT FK_DYNAMIC_TASK_TASK_PROPERTIES FOREIGN KEY (DYNAMIC_TASK_ID) REFERENCES
|
|
|
|
CONSTRAINT FK_DYNAMIC_TASK_TASK_PROPERTIES FOREIGN KEY (DYNAMIC_TASK_ID) REFERENCES
|
|
|
|
DYNAMIC_TASK (DYNAMIC_TASK_ID) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
DYNAMIC_TASK (DYNAMIC_TASK_ID) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- uem 5.3.2.0 to uem 5.3.3.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ALTER TABLE DM_OPERATION
|
|
|
|
|
|
|
|
ADD TENANT_ID INTEGER NOT NULL;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.INDEXES WHERE NAME = 'IDX_OP_CREATED' AND OBJECT_ID = OBJECT_ID('DM_OPERATION'))
|
|
|
|
|
|
|
|
CREATE INDEX IDX_OP_CREATED ON DM_OPERATION(CREATED_TIMESTAMP);
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.INDEXES WHERE NAME = 'IDX_OP_CODE' AND OBJECT_ID = OBJECT_ID('DM_OPERATION'))
|
|
|
|
|
|
|
|
CREATE INDEX IDX_OP_CODE ON DM_OPERATION(OPERATION_CODE);
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.INDEXES WHERE NAME = 'IDX_OP_INITIATED_BY' AND OBJECT_ID = OBJECT_ID('DM_OPERATION'))
|
|
|
|
|
|
|
|
CREATE INDEX IDX_OP_INITIATED_BY ON DM_OPERATION(INITIATED_BY);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.INDEXES WHERE NAME = 'IDX_ENROLMENT_OP_MAPPING_CREATED_TS' AND OBJECT_ID = OBJECT_ID('DM_ENROLMENT_OP_MAPPING'))
|
|
|
|
|
|
|
|
CREATE INDEX IDX_ENROLMENT_OP_MAPPING_CREATED_TS ON DM_ENROLMENT_OP_MAPPING(CREATED_TIMESTAMP);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ALTER TABLE DM_METADATA
|
|
|
|
|
|
|
|
ALTER COLUMN METADATA_VALUE TEXT NOT NULL;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ALTER TABLE DM_OTP_DATA
|
|
|
|
|
|
|
|
ALTER COLUMN META_INFO VARCHAR(8000) NULL;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.VIEWS WHERE NAME = 'FEATURE_NON_COMPLIANCE_INFO')
|
|
|
|
|
|
|
|
exec('CREATE VIEW FEATURE_NON_COMPLIANCE_INFO AS
|
|
|
|
|
|
|
|
SELECT TOP 100 PERCENT
|
|
|
|
|
|
|
|
DM_DEVICE.ID AS DEVICE_ID,
|
|
|
|
|
|
|
|
DM_DEVICE.DEVICE_IDENTIFICATION,
|
|
|
|
|
|
|
|
DM_DEVICE_DETAIL.DEVICE_MODEL,
|
|
|
|
|
|
|
|
DM_DEVICE_DETAIL.VENDOR,
|
|
|
|
|
|
|
|
DM_DEVICE_DETAIL.OS_VERSION,
|
|
|
|
|
|
|
|
DM_ENROLMENT.OWNERSHIP,
|
|
|
|
|
|
|
|
DM_ENROLMENT.OWNER,
|
|
|
|
|
|
|
|
DM_ENROLMENT.STATUS AS CONNECTIVITY_STATUS,
|
|
|
|
|
|
|
|
DM_POLICY_COMPLIANCE_STATUS.POLICY_ID,
|
|
|
|
|
|
|
|
DM_DEVICE_TYPE.NAME
|
|
|
|
|
|
|
|
AS PLATFORM,
|
|
|
|
|
|
|
|
DM_POLICY_COMPLIANCE_FEATURES.FEATURE_CODE,
|
|
|
|
|
|
|
|
DM_POLICY_COMPLIANCE_FEATURES.STATUS AS IS_COMPLAINT,
|
|
|
|
|
|
|
|
DM_DEVICE.TENANT_ID
|
|
|
|
|
|
|
|
FROM
|
|
|
|
|
|
|
|
DM_POLICY_COMPLIANCE_FEATURES, DM_POLICY_COMPLIANCE_STATUS, DM_ENROLMENT, DM_DEVICE, DM_DEVICE_TYPE, DM_DEVICE_DETAIL
|
|
|
|
|
|
|
|
WHERE
|
|
|
|
|
|
|
|
DM_POLICY_COMPLIANCE_FEATURES.COMPLIANCE_STATUS_ID = DM_POLICY_COMPLIANCE_STATUS.ID AND
|
|
|
|
|
|
|
|
DM_POLICY_COMPLIANCE_STATUS.ENROLMENT_ID =
|
|
|
|
|
|
|
|
DM_ENROLMENT.ID AND
|
|
|
|
|
|
|
|
DM_POLICY_COMPLIANCE_STATUS.DEVICE_ID = DM_DEVICE.ID AND
|
|
|
|
|
|
|
|
DM_DEVICE.DEVICE_TYPE_ID = DM_DEVICE_TYPE.ID AND
|
|
|
|
|
|
|
|
DM_DEVICE.ID = DM_DEVICE_DETAIL.DEVICE_ID
|
|
|
|
|
|
|
|
ORDER BY TENANT_ID, DEVICE_ID');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ALTER TABLE DM_DEVICE_SUB_TYPE
|
|
|
|
|
|
|
|
ALTER COLUMN DEVICE_TYPE VARCHAR(45) NOT NULL;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ALTER TABLE DM_DEVICE_SUB_TYPE
|
|
|
|
|
|
|
|
ALTER COLUMN SUB_TYPE_NAME VARCHAR(100) NOT NULL;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ALTER TABLE SUB_OPERATION_TEMPLATE
|
|
|
|
|
|
|
|
ALTER COLUMN DEVICE_TYPE VARCHAR(45) NOT NULL;
|
|
|
|
|
|
|
|
|