adding a new table to keep track of the profies pushed to an ios device

revert-dabc3590
inoshperera 8 years ago
parent 96cd41c634
commit b699cb8e4c

@ -31,3 +31,16 @@ CREATE TABLE IF NOT EXISTS `IOS_FEATURE` (
`DESCRIPTION` VARCHAR(200) NULL, `DESCRIPTION` VARCHAR(200) NULL,
PRIMARY KEY (`FEATURE_ID`) PRIMARY KEY (`FEATURE_ID`)
); );
-- -----------------------------------------------------
-- Table `IOS_DEVICE_PROFILE`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `IOS_DEVICE_PROFILE` (
`ID` INT NOT NULL AUTO_INCREMENT,
`OPERATION_ID` VARCHAR(10) NOT NULL,
`OPERATION_CODE` VARCHAR(1000) NULL,
`PROFILE_ID` VARCHAR(1000) NULL,
`DEVICE_IDENTIFICATION` VARCHAR(300) DEFAULT NULL,
`PROPERTIES` TEXT DEFAULT NULL,
PRIMARY KEY (`ID`)
);

@ -33,3 +33,16 @@ IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[I
LONGITUDE VARCHAR(45) NULL DEFAULT NULL, LONGITUDE VARCHAR(45) NULL DEFAULT NULL,
PRIMARY KEY (MOBILE_DEVICE_ID) PRIMARY KEY (MOBILE_DEVICE_ID)
); );
-- -----------------------------------------------------
-- Table `IOS_DEVICE_PROFILE`
-- -----------------------------------------------------
CREATE TABLE IOS_DEVICE_PROFILE (
ID INT NOT NULL IDENTITY,
OPERATION_ID VARCHAR(10) NOT NULL,
OPERATION_CODE VARCHAR(1000) NULL,
PROFILE_ID VARCHAR(1000) NULL,
DEVICE_IDENTIFICATION VARCHAR(300) DEFAULT NULL,
PROPERTIES VARCHAR(max) DEFAULT NULL,
PRIMARY KEY (ID)
);

@ -31,3 +31,17 @@ CREATE TABLE IF NOT EXISTS `IOS_FEATURE` (
`DESCRIPTION` VARCHAR(200) NULL, `DESCRIPTION` VARCHAR(200) NULL,
PRIMARY KEY (`FEATURE_ID`) PRIMARY KEY (`FEATURE_ID`)
) ENGINE = InnoDB; ) ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `IOS_DEVICE_PROFILE`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `IOS_DEVICE_PROFILE` (
`ID` INT NOT NULL AUTO_INCREMENT,
`OPERATION_ID` VARCHAR(10) NOT NULL,
`OPERATION_CODE` VARCHAR(1000) NULL,
`PROFILE_ID` VARCHAR(1000) NULL,
`DEVICE_IDENTIFICATION` VARCHAR(300) DEFAULT NULL,
`PROPERTIES` TEXT DEFAULT NULL,
PRIMARY KEY (`ID`)
);

@ -50,4 +50,28 @@ FOR EACH ROW
BEGIN BEGIN
SELECT IOS_FEATURE_ID_INC_SEQ.NEXTVAL INTO :NEW.ID FROM DUAL; SELECT IOS_FEATURE_ID_INC_SEQ.NEXTVAL INTO :NEW.ID FROM DUAL;
END; END;
/
-- -----------------------------------------------------
-- Table `IOS_DEVICE_PROFILE`
-- -----------------------------------------------------
CREATE TABLE IOS_DEVICE_PROFILE (
ID NUMBER(10) NOT NULL,
OPERATION_ID VARCHAR2(10) NOT NULL,
OPERATION_CODE VARCHAR2(1000) NULL,
PROFILE_ID VARCHAR2(1000) NULL,
DEVICE_IDENTIFICATION VARCHAR2(300) DEFAULT NULL,
PROPERTIES CLOB DEFAULT NULL,
PRIMARY KEY (ID)
);
-- Generate ID using sequence and trigger
CREATE SEQUENCE IOS_DEVICE_PROFILE_seq START WITH 1 INCREMENT BY 1;
CREATE OR REPLACE TRIGGER IOS_DEVICE_PROFILE_seq_tr
BEFORE INSERT ON IOS_DEVICE_PROFILE FOR EACH ROW
WHEN (NEW.ID IS NULL)
BEGIN
SELECT IOS_DEVICE_PROFILE_seq.NEXTVAL INTO :NEW.ID FROM DUAL;
END;
/ /

@ -31,3 +31,20 @@ CREATE TABLE IF NOT EXISTS IOS_DEVICE (
LONGITUDE VARCHAR(45) NULL DEFAULT NULL, LONGITUDE VARCHAR(45) NULL DEFAULT NULL,
PRIMARY KEY (MOBILE_DEVICE_ID) PRIMARY KEY (MOBILE_DEVICE_ID)
); );
-- -----------------------------------------------------
-- Table `IOS_DEVICE_PROFILE`
-- -----------------------------------------------------
CREATE SEQUENCE IOS_DEVICE_PROFILE_seq;
CREATE TABLE IF NOT EXISTS IOS_DEVICE_PROFILE (
ID INT NOT NULL DEFAULT NEXTVAL ('IOS_DEVICE_PROFILE_seq'),
OPERATION_ID VARCHAR(10) NOT NULL,
OPERATION_CODE VARCHAR(1000) NULL,
PROFILE_ID VARCHAR(1000) NULL,
DEVICE_IDENTIFICATION VARCHAR(300) DEFAULT NULL,
PROPERTIES TEXT DEFAULT NULL,
PRIMARY KEY (ID)
);

Loading…
Cancel
Save