diff --git a/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/h2.sql b/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/h2.sql index a115e5457..4164bc544 100644 --- a/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/h2.sql +++ b/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/h2.sql @@ -31,3 +31,16 @@ CREATE TABLE IF NOT EXISTS `IOS_FEATURE` ( `DESCRIPTION` VARCHAR(200) NULL, 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`) +); diff --git a/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/mssql.sql b/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/mssql.sql index 9d816fe8f..4f8be9cd3 100644 --- a/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/mssql.sql +++ b/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/mssql.sql @@ -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, 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) +); \ No newline at end of file diff --git a/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/mysql.sql b/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/mysql.sql index 3f617b7c7..badeb22cf 100644 --- a/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/mysql.sql +++ b/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/mysql.sql @@ -31,3 +31,17 @@ CREATE TABLE IF NOT EXISTS `IOS_FEATURE` ( `DESCRIPTION` VARCHAR(200) NULL, PRIMARY KEY (`FEATURE_ID`) ) 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`) +); diff --git a/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/oracle.sql b/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/oracle.sql index 232371731..b747da6ab 100644 --- a/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/oracle.sql +++ b/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/oracle.sql @@ -50,4 +50,28 @@ FOR EACH ROW BEGIN SELECT IOS_FEATURE_ID_INC_SEQ.NEXTVAL INTO :NEW.ID FROM DUAL; 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; / \ No newline at end of file diff --git a/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/postgresql.sql b/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/postgresql.sql index c03e68e4a..170e9d8e9 100644 --- a/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/postgresql.sql +++ b/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/postgresql.sql @@ -31,3 +31,20 @@ CREATE TABLE IF NOT EXISTS IOS_DEVICE ( LONGITUDE VARCHAR(45) NULL DEFAULT NULL, 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) +);