Merge pull request 'Fix errors with MSSQL cdm tables' (#256) from prathabanKavin/device-mgt-core:dbscriptfix into master

Reviewed-on: community/device-mgt-core#256
revert
commit f406399dca

@ -672,6 +672,7 @@ CREATE TABLE DM_METADATA (
-- END OF METADATA TABLE -- -- END OF METADATA TABLE --
-- DM_OTP_DATA TABLE -- -- DM_OTP_DATA TABLE --
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[DM_OTP_DATA]') AND TYPE IN (N'U'))
CREATE TABLE DM_OTP_DATA ( CREATE TABLE DM_OTP_DATA (
ID INT IDENTITY NOT NULL, ID INT IDENTITY NOT NULL,
OTP_TOKEN VARCHAR(100) NOT NULL, OTP_TOKEN VARCHAR(100) NOT NULL,
@ -721,7 +722,7 @@ DM_POLICY_COMPLIANCE_STATUS) DEVICE_WITH_POLICY_INFO
ON DEVICE_INFO.DEVICE_ID = DEVICE_WITH_POLICY_INFO.DEVICE_ID ON DEVICE_INFO.DEVICE_ID = DEVICE_WITH_POLICY_INFO.DEVICE_ID
ORDER BY DEVICE_INFO.DEVICE_ID'); ORDER BY DEVICE_INFO.DEVICE_ID');
IF NOT EXISTS (SELECT * FROM SYS.VIEWS WHERE NAME = 'CREATE VIEW FEATURE_NON_COMPLIANCE_INFO') IF NOT EXISTS (SELECT * FROM SYS.VIEWS WHERE NAME = 'FEATURE_NON_COMPLIANCE_INFO')
exec('CREATE VIEW FEATURE_NON_COMPLIANCE_INFO AS exec('CREATE VIEW FEATURE_NON_COMPLIANCE_INFO AS
SELECT TOP 100 PERCENT SELECT TOP 100 PERCENT
DM_DEVICE.ID AS DEVICE_ID, DM_DEVICE.ID AS DEVICE_ID,
@ -904,7 +905,7 @@ CREATE TABLE SUB_OPERATION_TEMPLATE (
OPERATION_DEFINITION VARCHAR(MAX) NOT NULL, OPERATION_DEFINITION VARCHAR(MAX) NOT NULL,
OPERATION_CODE varchar(100) NOT NULL, OPERATION_CODE varchar(100) NOT NULL,
SUB_TYPE_ID VARCHAR(45) NOT NULL, SUB_TYPE_ID VARCHAR(45) NOT NULL,
DEVICE_TYPE VARCHAR(25) NOT NULL, DEVICE_TYPE VARCHAR(45) NOT NULL,
CREATE_TIMESTAMP BIGINT NULL DEFAULT NULL, CREATE_TIMESTAMP BIGINT NULL DEFAULT NULL,
UPDATE_TIMESTAMP BIGINT NULL DEFAULT NULL, UPDATE_TIMESTAMP BIGINT NULL DEFAULT NULL,
PRIMARY KEY (SUB_OPERATION_TEMPLATE_ID), PRIMARY KEY (SUB_OPERATION_TEMPLATE_ID),
@ -912,4 +913,4 @@ CREATE TABLE SUB_OPERATION_TEMPLATE (
CONSTRAINT fk_SUB_OPERATION_TEMPLATE_DM_DEVICE_SUB_TYPE FOREIGN KEY (SUB_TYPE_ID, DEVICE_TYPE) REFERENCES DM_DEVICE_SUB_TYPE (SUB_TYPE_ID, DEVICE_TYPE) CONSTRAINT fk_SUB_OPERATION_TEMPLATE_DM_DEVICE_SUB_TYPE FOREIGN KEY (SUB_TYPE_ID, DEVICE_TYPE) REFERENCES DM_DEVICE_SUB_TYPE (SUB_TYPE_ID, DEVICE_TYPE)
); );
-- END SUB_OPERATION_TEMPLATE TABLE-- -- END SUB_OPERATION_TEMPLATE TABLE--

Loading…
Cancel
Save