revert-70aa11f8
geethkokila 9 years ago
commit f29cacffff

@ -100,11 +100,11 @@ CREATE TABLE DM_DEVICE_GROUP_MAP (
REFERENCES DM_DEVICE (ID), REFERENCES DM_DEVICE (ID),
CONSTRAINT fk_DM_DEV_GROUP_MAP_DM_GROUP2 FOREIGN KEY (GROUP_ID) CONSTRAINT fk_DM_DEV_GROUP_MAP_DM_GROUP2 FOREIGN KEY (GROUP_ID)
REFERENCES DM_GROUP (ID) REFERENCES DM_GROUP (ID)
); )
/
-- Generate ID using sequence and trigger -- Generate ID using sequence and trigger
CREATE SEQUENCE DM_DEVICE_GROUP_MAP_seq START WITH 1 INCREMENT BY 1; CREATE SEQUENCE DM_DEVICE_GROUP_MAP_seq START WITH 1 INCREMENT BY 1 NOCACHE
/
CREATE OR REPLACE TRIGGER DM_DEVICE_GROUP_MAP_seq_tr CREATE OR REPLACE TRIGGER DM_DEVICE_GROUP_MAP_seq_tr
BEFORE INSERT ON DM_DEVICE_GROUP_MAP FOR EACH ROW BEFORE INSERT ON DM_DEVICE_GROUP_MAP FOR EACH ROW
WHEN (NEW.ID IS NULL) WHEN (NEW.ID IS NULL)
@ -448,7 +448,7 @@ CREATE TABLE DM_DEVICE_POLICY_APPLIED (
CREATED_TIME TIMESTAMP(0) NULL , CREATED_TIME TIMESTAMP(0) NULL ,
UPDATED_TIME TIMESTAMP(0) NULL , UPDATED_TIME TIMESTAMP(0) NULL ,
APPLIED_TIME TIMESTAMP(0) NULL , APPLIED_TIME TIMESTAMP(0) NULL ,
CONSTRAINT PK_DM_POLICY_DEV_APPLIED PRIMARY KEY (ID) , CONSTRAINT PK_DM_POLICY_DEV_APPLIED PRIMARY KEY (ID),
CONSTRAINT FK_DM_POLICY_DEV_APPLIED CONSTRAINT FK_DM_POLICY_DEV_APPLIED
FOREIGN KEY (DEVICE_ID ) FOREIGN KEY (DEVICE_ID )
REFERENCES DM_DEVICE (ID ) REFERENCES DM_DEVICE (ID )
@ -633,11 +633,11 @@ CREATE TABLE DM_DEVICE_GROUP_POLICY (
CONSTRAINT FK_DM_DEVICE_GROUP_DM_POLICY CONSTRAINT FK_DM_DEVICE_GROUP_DM_POLICY
FOREIGN KEY (POLICY_ID) FOREIGN KEY (POLICY_ID)
REFERENCES DM_POLICY (ID) REFERENCES DM_POLICY (ID)
) ; )
/
-- Generate ID using sequence and trigger -- Generate ID using sequence and trigger
CREATE SEQUENCE DM_DEVICE_GROUP_POLICY_seq START WITH 1 INCREMENT BY 1; CREATE SEQUENCE DM_DEVICE_GROUP_POLICY_seq START WITH 1 INCREMENT BY 1 NOCACHE
/
CREATE OR REPLACE TRIGGER DM_DEVICE_GROUP_POLICY_seq_tr CREATE OR REPLACE TRIGGER DM_DEVICE_GROUP_POLICY_seq_tr
BEFORE INSERT ON DM_DEVICE_GROUP_POLICY FOR EACH ROW BEFORE INSERT ON DM_DEVICE_GROUP_POLICY FOR EACH ROW
WHEN (NEW.ID IS NULL) WHEN (NEW.ID IS NULL)
@ -758,11 +758,11 @@ CREATE TABLE DM_DEVICE_INFO (
FOREIGN KEY (DEVICE_ID) FOREIGN KEY (DEVICE_ID)
REFERENCES DM_DEVICE (ID) REFERENCES DM_DEVICE (ID)
) )
; /
-- Generate ID using sequence and trigger -- Generate ID using sequence and trigger
CREATE SEQUENCE DM_DEVICE_INFO_seq START WITH 1 INCREMENT BY 1; CREATE SEQUENCE DM_DEVICE_INFO_seq START WITH 1 INCREMENT BY 1 NOCACHE
/
CREATE OR REPLACE TRIGGER DM_DEVICE_INFO_seq_tr CREATE OR REPLACE TRIGGER DM_DEVICE_INFO_seq_tr
BEFORE INSERT ON DM_DEVICE_INFO FOR EACH ROW BEFORE INSERT ON DM_DEVICE_INFO FOR EACH ROW
WHEN (NEW.ID IS NULL) WHEN (NEW.ID IS NULL)
@ -796,11 +796,11 @@ CREATE TABLE DM_DEVICE_LOCATION (
FOREIGN KEY (DEVICE_ID) FOREIGN KEY (DEVICE_ID)
REFERENCES DM_DEVICE (ID) REFERENCES DM_DEVICE (ID)
) )
; /
-- Generate ID using sequence and trigger -- Generate ID using sequence and trigger
CREATE SEQUENCE DM_DEVICE_LOCATION_seq START WITH 1 INCREMENT BY 1; CREATE SEQUENCE DM_DEVICE_LOCATION_seq START WITH 1 INCREMENT BY 1 NOCACHE
/
CREATE OR REPLACE TRIGGER DM_DEVICE_LOCATION_seq_tr CREATE OR REPLACE TRIGGER DM_DEVICE_LOCATION_seq_tr
BEFORE INSERT ON DM_DEVICE_LOCATION FOR EACH ROW BEFORE INSERT ON DM_DEVICE_LOCATION FOR EACH ROW
WHEN (NEW.ID IS NULL) WHEN (NEW.ID IS NULL)
@ -838,11 +838,11 @@ CREATE TABLE DM_DEVICE_DETAIL (
CONSTRAINT FK_DM_DEVICE_DETAILS_DEVICE CONSTRAINT FK_DM_DEVICE_DETAILS_DEVICE
FOREIGN KEY (DEVICE_ID) FOREIGN KEY (DEVICE_ID)
REFERENCES DM_DEVICE (ID) REFERENCES DM_DEVICE (ID)
); )
/
-- Generate ID using sequence and trigger -- Generate ID using sequence and trigger
CREATE SEQUENCE DM_DEVICE_DETAIL_seq START WITH 1 INCREMENT BY 1; CREATE SEQUENCE DM_DEVICE_DETAIL_seq START WITH 1 INCREMENT BY 1 NOCACHE
/
CREATE OR REPLACE TRIGGER DM_DEVICE_DETAIL_seq_tr CREATE OR REPLACE TRIGGER DM_DEVICE_DETAIL_seq_tr
BEFORE INSERT ON DM_DEVICE_DETAIL FOR EACH ROW BEFORE INSERT ON DM_DEVICE_DETAIL FOR EACH ROW
WHEN (NEW.ID IS NULL) WHEN (NEW.ID IS NULL)
@ -853,7 +853,7 @@ WHEN (NEW.ID IS NULL)
-- DASHBOARD RELATED VIEWS -- -- DASHBOARD RELATED VIEWS --
CREATE VIEW DEVICES_WITH_POLICY_COMPLIANCE_STATUS AS CREATE VIEW POLICY_COMPLIANCE_INFO AS
SELECT SELECT
DEVICE_INFO.DEVICE_ID, DEVICE_INFO.DEVICE_ID,
DEVICE_INFO.DEVICE_IDENTIFICATION, DEVICE_INFO.DEVICE_IDENTIFICATION,
@ -881,8 +881,8 @@ STATUS AS IS_COMPLIANT
FROM DM_POLICY_COMPLIANCE_STATUS) DEVICE_WITH_POLICY_INFO FROM 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;
/
CREATE VIEW DEVICES_WITH_NON_COMPLIANT_FEATURES AS CREATE VIEW FEATURE_NON_COMPLIANCE_INFO AS
SELECT SELECT
DM_DEVICE.ID AS DEVICE_ID, DM_DEVICE.ID AS DEVICE_ID,
DM_DEVICE.DEVICE_IDENTIFICATION, DM_DEVICE.DEVICE_IDENTIFICATION,

Loading…
Cancel
Save