diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/mssql_android.sql b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/mssql_android.sql new file mode 100644 index 0000000000..3309b033a3 --- /dev/null +++ b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/mssql_android.sql @@ -0,0 +1,53 @@ +-- ----------------------------------------------------- +-- Table `AD_DEVICE` +-- ----------------------------------------------------- +CREATE TABLE AD_DEVICE ( + [ANDROID_DEVICE_ID] VARCHAR(45) NOT NULL, + [GCM_TOKEN] VARCHAR(45) NULL DEFAULT NULL, + [DEVICE_INFO] VARCHAR(8000) NULL DEFAULT NULL, + [IMEI] VARCHAR(45) NULL DEFAULT NULL, + [IMSI] VARCHAR(45) NULL DEFAULT NULL, + [OS_VERSION] VARCHAR(45) NULL DEFAULT NULL, + [DEVICE_MODEL] VARCHAR(45) NULL DEFAULT NULL, + [VENDOR] VARCHAR(45) NULL DEFAULT NULL, + [LATITUDE] VARCHAR(45) NULL DEFAULT NULL, + [LONGITUDE] VARCHAR(45) NULL DEFAULT NULL, + [SERIAL] VARCHAR(45) NULL DEFAULT NULL, + [MAC_ADDRESS] VARCHAR(45) NULL DEFAULT NULL, + [DEVICE_NAME] VARCHAR(100) NULL DEFAULT NULL, + PRIMARY KEY ([ANDROID_DEVICE_ID])); + +-- ----------------------------------------------------- +-- Table `AD_FEATURE` +-- ----------------------------------------------------- +CREATE TABLE AD_FEATURE ( + [ID] INT NOT NULL IDENTITY, + [CODE] VARCHAR(45) NOT NULL, + [NAME] VARCHAR(100) NULL, + [DESCRIPTION] VARCHAR(200) NULL, + PRIMARY KEY ([ID])); + +-- ----------------------------------------------------- +-- TODO remove this later +-- ----------------------------------------------------- +INSERT INTO AD_FEATURE (CODE, NAME, DESCRIPTION) +VALUES +('DEVICE_LOCK', 'Device Lock', 'Lock the device'), +('DEVICE_LOCATION', 'Location', 'Request coordinates of device location'), +('WIFI', 'Wifi', 'Setting up wifi configuration'), +('CAMERA', 'Camera', 'Enable or disable camera'), +('EMAIL', 'Email', 'Configure email settings'), +('DEVICE_MUTE', 'Mute', 'Enable mute in the device'), +('DEVICE_INFO', 'Device Info', 'Request device information'), +('ENTERPRISE_WIPE', 'Enterprise Wipe', 'Remove enterprise applications'), +('CLEAR_PASSWORD', 'Clear Password', 'Clear current password'), +('WIPE_DATA', 'Wipe Data', 'Factory reset the device'), +('APPLICATION_LIST', 'Application List', 'Request list of current installed applications'), +('CHANGE_LOCK_CODE', 'Change Lock-code', 'Change current lock code'), +('INSTALL_APPLICATION', 'Install App', 'Install Enterprise or Market application'), +('UNINSTALL_APPLICATION', 'Uninstall App', 'Uninstall application'), +('BLACKLIST_APPLICATIONS', 'Blacklist app', 'Blacklist applications'), +('ENCRYPT_STORAGE', 'Encrypt storage', 'Encrypt storage'), +('DEVICE_RING', 'Ring', 'Ring the device'), +('PASSCODE_POLICY', 'Password Policy', 'Set passcode policy'), +('NOTIFICATION', 'Message', 'Send message'); \ No newline at end of file diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/mssql_ios.sql b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/mssql_ios.sql new file mode 100644 index 0000000000..871c996eba --- /dev/null +++ b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/mssql_ios.sql @@ -0,0 +1,69 @@ +-- ----------------------------------------------------- +-- Table `IOS_FEATURE` +-- ----------------------------------------------------- +CREATE TABLE IOS_FEATURE ( + [FEATURE_ID] INT NOT NULL IDENTITY, + [CODE] VARCHAR(45) NOT NULL, + [NAME] VARCHAR(100) NULL, + [DESCRIPTION] VARCHAR(200) NULL, + PRIMARY KEY ([FEATURE_ID]) ) + ; + + +-- ----------------------------------------------------- +-- Table `IOS_DEVICE` +-- ----------------------------------------------------- + CREATE TABLE IOS_DEVICE ( + [MOBILE_DEVICE_ID] VARCHAR(45) NOT NULL, + [APNS_PUSH_TOKEN] VARCHAR(100) NULL DEFAULT NULL, + [MAGIC_TOKEN] VARCHAR(100) NULL DEFAULT NULL, + [MDM_TOKEN] VARCHAR(100) NULL DEFAULT NULL, + [UNLOCK_TOKEN] VARCHAR(2000) NULL DEFAULT NULL, + [CHALLENGE_TOKEN] VARCHAR(45) NULL DEFAULT NULL, + [DEVICE_INFO] VARCHAR(8000) NULL DEFAULT NULL, + [SERIAL] VARCHAR(45) NULL DEFAULT NULL, + [PRODUCT] VARCHAR(45) NULL DEFAULT NULL, + [IMEI] VARCHAR(45) NULL DEFAULT NULL, + [VERSION] VARCHAR(45) NULL DEFAULT NULL, + [MAC_ADDRESS] VARCHAR(45) NULL DEFAULT NULL, + [DEVICE_NAME] VARCHAR(100) NULL DEFAULT NULL, + [ICCID] VARCHAR(45) NULL DEFAULT NULL, + [LATITUDE] VARCHAR(45) NULL DEFAULT NULL, + [LONGITUDE] VARCHAR(45) NULL DEFAULT NULL, + PRIMARY KEY ([MOBILE_DEVICE_ID]) ) + ; + + +-- ----------------------------------------------------- +-- TODO remove this later +-- ----------------------------------------------------- + +INSERT INTO IOS_FEATURE (CODE, NAME, DESCRIPTION) VALUES + ('INSTALL_ENTERPRISE_APPLICATION', 'Install Enterprise App', 'Install Enterprise App'), + ('INSTALL_STORE_APPLICATION', 'Install Public App', 'Install Public App'), + ('REMOVE_APPLICATION', 'Uninstall App', 'Uninstall App'), + ('DEVICE_LOCK', 'Device Lock', 'Device Lock'), + ('CELLULAR', 'Cellular', 'Cellular'), + ('APN', 'APN', 'APN'), + ('RESTRICTION', 'Restrictions', 'Restrictions operation'), + ('WIFI', 'Wifi', 'Wifi'), + ('DEVICE_INFO', 'Device Info', 'Device info operation'), + ('AIR_PLAY', 'Air Play', 'AirPlay operation'), + ('LOCATION', 'Location', 'Fetch location'), + ('ALARM', 'Alarm', 'Alarm device'), + ('APPLICATION_LIST', 'Application list', 'Application list'), + ('PROFILE_LIST', 'Profile List', 'Profile list'), + ('REMOVE_PROFILE', 'Remove Profile', 'Remove profile'), + ('CLEAR_PASSCODE', 'Clear Passcode', 'Clear passcode'), + ('CALDAV', 'CalDev', 'Setup CalDav'), + ('CALENDAR_SUBSCRIPTION', 'Calendar Subscriptions', 'Calendar subscription'), + ('PASSCODE_POLICY', 'Passcode Policy', 'Passcode policy'), + ('EMAIL', 'Email', 'Email operation'), + ('LDAP', 'LDAP', 'LDAP operation'), + ('WEB_CLIP', 'Web Clip', 'Web clip operation'), + ('VPN', 'VPN', 'VPN operation'), + ('PER_APP_VPN', 'Per App VPN', 'Per app VPN operation'), + ('APP_TO_PER_APP_VPN_MAPPING', 'VPN App mapping', 'App to per app VPN mapping operation'), + ('ENTERPRISE_WIPE', 'Enterprise Wipe', 'Enterprise wipe operation'), + ('APP_LOCK', 'App lock', 'App lock operation'), + ('GET_RESTRICTIONS', 'Get restrictions', 'Get restrictions operation'); diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/mssql_windows.sql b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/mssql_windows.sql new file mode 100644 index 0000000000..6f42b553b1 --- /dev/null +++ b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/mssql_windows.sql @@ -0,0 +1,61 @@ +-- ----------------------------------------------------- +-- Table `WINDOWS_FEATURE` +-- ----------------------------------------------------- +CREATE TABLE WINDOWS_FEATURE ( + [FEATURE_ID] INT NOT NULL IDENTITY, + [CODE] VARCHAR(45) NOT NULL, + [NAME] VARCHAR(100) NULL, + [DESCRIPTION] VARCHAR(200) NULL, + PRIMARY KEY ([FEATURE_ID])) + ; + + -- ----------------------------------------------------- +-- Table `WINDOWS_DEVICE` +-- ----------------------------------------------------- + CREATE TABLE WINDOWS_DEVICE ( + [MOBILE_DEVICE_ID] VARCHAR(45) NOT NULL, + [CHANNEL_URI] VARCHAR(100) NULL DEFAULT NULL, + [DEVICE_INFO] VARCHAR(8000) NULL DEFAULT NULL, + [IMEI] VARCHAR(45) NULL DEFAULT NULL, + [IMSI] VARCHAR(45) NULL DEFAULT NULL, + [OS_VERSION] VARCHAR(45) NULL DEFAULT NULL, + [DEVICE_MODEL] VARCHAR(45) NULL DEFAULT NULL, + [VENDOR] VARCHAR(45) NULL DEFAULT NULL, + [LATITUDE] VARCHAR(45) NULL DEFAULT NULL, + [LONGITUDE] VARCHAR(45) NULL DEFAULT NULL, + [SERIAL] VARCHAR(45) NULL DEFAULT NULL, + [MAC_ADDRESS] VARCHAR(45) NULL DEFAULT NULL, + [DEVICE_NAME] VARCHAR(100) NULL DEFAULT NULL, + PRIMARY KEY ([MOBILE_DEVICE_ID])); + +-- ----------------------------------------------------- +-- TODO remove this later +-- ----------------------------------------------------- +INSERT INTO WINDOWS_FEATURE (CODE, NAME, DESCRIPTION) VALUES +('INSTALL_ENTERPRISE_APPLICATION', 'Install Enterprise App', 'Install Enterprise App'), +
('INSTALL_STORE_APPLICATION', 'Install Public App', 'Install Public App'), 
 +('REMOVE_APPLICATION', 'Uninstall App', 'Uninstall App'), +
('DEVICE_LOCK', 'Device Lock', 'Device Lock'), +
('CELLULAR', 'Cellular', 'Cellular'), +
('APN', 'APN', 'APN'), +
('RESTRICTION', 'Restrictions', 'Restrictions operation'), +
('WIFI', 'Wifi', 'Wifi'), +
('DEVICE_INFO', 'Device Info', 'Device info operation'), 
 +('AIR_PLAY', 'Air Play', 'AirPlay operation'), 
 +('LOCATION', 'Location', 'Fetch location'), 
 +('ALARM', 'Alarm', 'Alarm device'), +('APPLICATION_LIST', 'Application list', 'Application list'), +('PROFILE_LIST', 'Profile List', 'Profile list'), +('REMOVE_PROFILE', 'Remove Profile', 'Remove profile'), +('CLEAR_PASSCODE', 'Clear Passcode', 'Clear passcode'), +('CALDAV', 'CalDev', 'Setup CalDav'), +('CALENDAR_SUBSCRIPTION', 'Calendar Subscriptions', 'Calendar subscription'), +('PASSCODE_POLICY', 'Passcode Policy', 'Passcode policy'), +('EMAIL', 'Email', 'Email operation'), +('LDAP', 'LDAP', 'LDAP operation'), +('WEB_CLIP', 'Web Clip', 'Web clip operation'), +('VPN', 'VPN', 'VPN operation'), +('PER_APP_VPN', 'Per App VPN', 'Per app VPN operation'), +('APP_TO_PER_APP_VPN_MAPPING', 'VPN App mapping', 'App to per app VPN mapping operation'), +('ENTERPRISE_WIPE', 'Enterprise Wipe', 'Enterprise wipe operation'), +('APP_LOCK', 'App lock', 'App lock operation'); \ No newline at end of file diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/mysql_android.sql b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/mysql_android.sql index 2c5ed863ce..7161791dd3 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/mysql_android.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/mysql_android.sql @@ -1,10 +1,10 @@ -- ----------------------------------------------------- --- Table `MBL_DEVICE` +-- Table `AD_DEVICE` -- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `AD_DEVICE` ( - `ANDROID_DEVICE_ID` VARCHAR(45) NOT NULL , - `DEVICE_INFO` VARCHAR(500) NULL DEFAULT NULL, +CREATE TABLE IF NOT EXISTS `AD_DEVICE` ( + `ANDROID_DEVICE_ID` VARCHAR(45) NOT NULL, `GCM_TOKEN` VARCHAR(45) NULL DEFAULT NULL, + `DEVICE_INFO` VARCHAR(8000) NULL DEFAULT NULL, `IMEI` VARCHAR(45) NULL DEFAULT NULL, `IMSI` VARCHAR(45) NULL DEFAULT NULL, `OS_VERSION` VARCHAR(45) NULL DEFAULT NULL, @@ -16,11 +16,10 @@ CREATE TABLE IF NOT EXISTS `AD_DEVICE` ( `MAC_ADDRESS` VARCHAR(45) NULL DEFAULT NULL, `DEVICE_NAME` VARCHAR(100) NULL DEFAULT NULL, PRIMARY KEY (`ANDROID_DEVICE_ID`)) -ENGINE = InnoDB; - + ENGINE = InnoDB; -- ----------------------------------------------------- --- Table `MBL_FEATURE` +-- Table `AD_FEATURE` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `AD_FEATURE` ( `ID` INT NOT NULL AUTO_INCREMENT, @@ -28,5 +27,31 @@ CREATE TABLE IF NOT EXISTS `AD_FEATURE` ( `NAME` VARCHAR(100) NULL, `DESCRIPTION` VARCHAR(200) NULL, PRIMARY KEY (`ID`)) -ENGINE = InnoDB; + ENGINE = InnoDB; + + +-- ----------------------------------------------------- +-- TODO remove this later +-- ----------------------------------------------------- +INSERT INTO AD_FEATURE (CODE, NAME, DESCRIPTION) +VALUES +('DEVICE_LOCK', 'Device Lock', 'Lock the device'), +('DEVICE_LOCATION', 'Location', 'Request coordinates of device location'), +('WIFI', 'Wifi', 'Setting up wifi configuration'), +('CAMERA', 'Camera', 'Enable or disable camera'), +('EMAIL', 'Email', 'Configure email settings'), +('DEVICE_MUTE', 'Mute', 'Enable mute in the device'), +('DEVICE_INFO', 'Device Info', 'Request device information'), +('ENTERPRISE_WIPE', 'Enterprise Wipe', 'Remove enterprise applications'), +('CLEAR_PASSWORD', 'Clear Password', 'Clear current password'), +('WIPE_DATA', 'Wipe Data', 'Factory reset the device'), +('APPLICATION_LIST', 'Application List', 'Request list of current installed applications'), +('CHANGE_LOCK_CODE', 'Change Lock-code', 'Change current lock code'), +('INSTALL_APPLICATION', 'Install App', 'Install Enterprise or Market application'), +('UNINSTALL_APPLICATION', 'Uninstall App', 'Uninstall application'), +('BLACKLIST_APPLICATIONS', 'Blacklist app', 'Blacklist applications'), +('ENCRYPT_STORAGE', 'Encrypt storage', 'Encrypt storage'), +('DEVICE_RING', 'Ring', 'Ring the device'), +('PASSCODE_POLICY', 'Password Policy', 'Set passcode policy'), +('NOTIFICATION', 'Message', 'Send message'); diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/mysql_ios.sql b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/mysql_ios.sql index 1b90f68c69..58abd26276 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/mysql_ios.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/mysql_ios.sql @@ -13,7 +13,6 @@ CREATE TABLE IF NOT EXISTS `IOS_FEATURE` ( -- ----------------------------------------------------- -- Table `IOS_DEVICE` -- ----------------------------------------------------- - CREATE TABLE IF NOT EXISTS `IOS_DEVICE` ( `MOBILE_DEVICE_ID` VARCHAR(45) NOT NULL, `APNS_PUSH_TOKEN` VARCHAR(100) NULL DEFAULT NULL, @@ -35,4 +34,36 @@ CREATE TABLE IF NOT EXISTS `IOS_FEATURE` ( ENGINE = InnoDB; -long +-- ----------------------------------------------------- +-- TODO remove this later +-- ----------------------------------------------------- + +INSERT INTO IOS_FEATURE (CODE, NAME, DESCRIPTION) VALUES + ('INSTALL_ENTERPRISE_APPLICATION', 'Install Enterprise App', 'Install Enterprise App'), + ('INSTALL_STORE_APPLICATION', 'Install Public App', 'Install Public App'), + ('REMOVE_APPLICATION', 'Uninstall App', 'Uninstall App'), + ('DEVICE_LOCK', 'Device Lock', 'Device Lock'), + ('CELLULAR', 'Cellular', 'Cellular'), + ('APN', 'APN', 'APN'), + ('RESTRICTION', 'Restrictions', 'Restrictions operation'), + ('WIFI', 'Wifi', 'Wifi'), + ('DEVICE_INFO', 'Device Info', 'Device info operation'), + ('AIR_PLAY', 'Air Play', 'AirPlay operation'), + ('LOCATION', 'Location', 'Fetch location'), + ('ALARM', 'Alarm', 'Alarm device'), + ('APPLICATION_LIST', 'Application list', 'Application list'), + ('PROFILE_LIST', 'Profile List', 'Profile list'), + ('REMOVE_PROFILE', 'Remove Profile', 'Remove profile'), + ('CLEAR_PASSCODE', 'Clear Passcode', 'Clear passcode'), + ('CALDAV', 'CalDev', 'Setup CalDav'), + ('CALENDAR_SUBSCRIPTION', 'Calendar Subscriptions', 'Calendar subscription'), + ('PASSCODE_POLICY', 'Passcode Policy', 'Passcode policy'), + ('EMAIL', 'Email', 'Email operation'), + ('LDAP', 'LDAP', 'LDAP operation'), + ('WEB_CLIP', 'Web Clip', 'Web clip operation'), + ('VPN', 'VPN', 'VPN operation'), + ('PER_APP_VPN', 'Per App VPN', 'Per app VPN operation'), + ('APP_TO_PER_APP_VPN_MAPPING', 'VPN App mapping', 'App to per app VPN mapping operation'), + ('ENTERPRISE_WIPE', 'Enterprise Wipe', 'Enterprise wipe operation'), + ('APP_LOCK', 'App lock', 'App lock operation'), + ('GET_RESTRICTIONS', 'Get restrictions', 'Get restrictions operation'); diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/mysql_windows.sql b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/mysql_windows.sql index dfabdc0090..061b7f5251 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/mysql_windows.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/mysql_windows.sql @@ -1,9 +1,24 @@ -- ----------------------------------------------------- --- Table `MBL_DEVICE` +-- Table `WINDOWS_FEATURE` -- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `MBL_DEVICE` ( +CREATE TABLE IF NOT EXISTS `WINDOWS_FEATURE` ( + `FEATURE_ID` INT NOT NULL AUTO_INCREMENT, + `CODE` VARCHAR(45) NOT NULL, + `NAME` VARCHAR(100) NULL, + `DESCRIPTION` VARCHAR(200) NULL, + PRIMARY KEY (`FEATURE_ID`)) + ENGINE = InnoDB; + + + +-- ----------------------------------------------------- +-- Table `WINDOWS_DEVICE` +-- ----------------------------------------------------- + + CREATE TABLE IF NOT EXISTS `WINDOWS_DEVICE` ( `MOBILE_DEVICE_ID` VARCHAR(45) NOT NULL, - `PUSH_TOKEN` VARCHAR(45) NULL DEFAULT NULL, + `CHANNEL_URI` VARCHAR(100) NULL DEFAULT NULL, + `DEVICE_INFO` VARCHAR(8000) NULL DEFAULT NULL, `IMEI` VARCHAR(45) NULL DEFAULT NULL, `IMSI` VARCHAR(45) NULL DEFAULT NULL, `OS_VERSION` VARCHAR(45) NULL DEFAULT NULL, @@ -11,42 +26,42 @@ CREATE TABLE IF NOT EXISTS `MBL_DEVICE` ( `VENDOR` VARCHAR(45) NULL DEFAULT NULL, `LATITUDE` VARCHAR(45) NULL DEFAULT NULL, `LONGITUDE` VARCHAR(45) NULL DEFAULT NULL, - `CHALLENGE` VARCHAR(45) NULL DEFAULT NULL, - `TOKEN` VARCHAR(50) NULL DEFAULT NULL, - `UNLOCK_TOKEN` VARCHAR(2000) NULL DEFAULT NULL, `SERIAL` VARCHAR(45) NULL DEFAULT NULL, + `MAC_ADDRESS` VARCHAR(45) NULL DEFAULT NULL, + `DEVICE_NAME` VARCHAR(100) NULL DEFAULT NULL, PRIMARY KEY (`MOBILE_DEVICE_ID`)) -ENGINE = InnoDB; + ENGINE = InnoDB; -- ----------------------------------------------------- --- Table `MBL_FEATURE` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `MBL_FEATURE` ( - `FEATURE_ID` INT NOT NULL AUTO_INCREMENT, - `DEVICE_TYPE` VARCHAR(45) NOT NULL, - `CODE` VARCHAR(45) NULL, - `NAME` VARCHAR(100) NULL, - `DESCRIPTION` VARCHAR(200) NULL, - PRIMARY KEY (`FEATURE_ID`)) -ENGINE = InnoDB; - --- ----------------------------------------------------- --- Table `MBL_FEATURE_PROPERTY` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `MBL_FEATURE_PROPERTY` ( - `PROPERTY` VARCHAR(45) NOT NULL , - `FEATURE_ID` INT NOT NULL , - PRIMARY KEY (`PROPERTY`), - CONSTRAINT `fk_MBL_FEATURE_PROPERTY_MBL_FEATURE1` - FOREIGN KEY (`FEATURE_ID`) - REFERENCES `MBL_FEATURE` (`FEATURE_ID`) - ON DELETE NO ACTION - ON UPDATE NO ACTION) -ENGINE = InnoDB; - --- ----------------------------------------------------- --- Inserts +-- TODO remove this later -- ----------------------------------------------------- -INSERT INTO MBL_FEATURE (DEVICE_TYPE,NAME,CODE, DESCRIPTION) VALUES ('android','DEVICE_LOCK','503A','Device Lock'),('android','WIPE','504A','Device Wipe'),('android','CLEARPASSCODE','505A','Clear Passcode'),('android','APPLIST','502A','Get All Applications'),('android','LOCATION','501A','Location'),('android','INFO','500A','Device Information'),('android','NOTIFICATION','506A','Message'),('android','WIFI','507A','Setup Wifi'),('android','CAMERA','508A','Camera Control'),('android','MUTE','513A','Mute Device'),('android','INSTALLAPP','509A','Install Application'),('android','UNINSTALLAPP','510A','Uninstall Application'),('android','ENCRYPT','511A','Encrypt Storage'),('android','APN','512A','APN'),('android','WEBCLIP','518A','Create Webclips'),('android','PASSWORDPOLICY','519A','Passcode Policy'),('android','EMAIL','520A','Email Configuration'),('android','GOOGLECALENDAR','521A','Calender Subscription'),('android','VPN','523A','VPN'),('android','LDAP','524A','LDAP'),('android','CHANGEPASSWORD','526A','Set Passcode'),('android','ENTERPRISEWIPE','527A','Enterprise Wipe'),('android','POLICY','500P','Policy Enforcement'),('android','MONITORING','501P','Policy Monitoring '),('android','BLACKLISTAPPS','528B','Blacklist Apps'),('android','REVOKEPOLICY','502P','Revoke Policy'); +INSERT INTO WINDOWS_FEATURE (CODE, NAME, DESCRIPTION) VALUES + ('INSTALL_ENTERPRISE_APPLICATION', 'Install Enterprise App', 'Install Enterprise App'), + ('INSTALL_STORE_APPLICATION', 'Install Public App', 'Install Public App'), + ('REMOVE_APPLICATION', 'Uninstall App', 'Uninstall App'), + ('DEVICE_LOCK', 'Device Lock', 'Device Lock'), + ('CELLULAR', 'Cellular', 'Cellular'), + ('APN', 'APN', 'APN'), + ('RESTRICTION', 'Restrictions', 'Restrictions operation'), + ('WIFI', 'Wifi', 'Wifi'), + ('DEVICE_INFO', 'Device Info', 'Device info operation'), + ('AIR_PLAY', 'Air Play', 'AirPlay operation'), + ('LOCATION', 'Location', 'Fetch location'), + ('ALARM', 'Alarm', 'Alarm device'), + ('APPLICATION_LIST', 'Application list', 'Application list'), + ('PROFILE_LIST', 'Profile List', 'Profile list'), + ('REMOVE_PROFILE', 'Remove Profile', 'Remove profile'), + ('CLEAR_PASSCODE', 'Clear Passcode', 'Clear passcode'), + ('CALDAV', 'CalDev', 'Setup CalDav'), + ('CALENDAR_SUBSCRIPTION', 'Calendar Subscriptions', 'Calendar subscription'), + ('PASSCODE_POLICY', 'Passcode Policy', 'Passcode policy'), + ('EMAIL', 'Email', 'Email operation'), + ('LDAP', 'LDAP', 'LDAP operation'), + ('WEB_CLIP', 'Web Clip', 'Web clip operation'), + ('VPN', 'VPN', 'VPN operation'), + ('PER_APP_VPN', 'Per App VPN', 'Per app VPN operation'), + ('APP_TO_PER_APP_VPN_MAPPING', 'VPN App mapping', 'App to per app VPN mapping operation'), + ('ENTERPRISE_WIPE', 'Enterprise Wipe', 'Enterprise wipe operation'), + ('APP_LOCK', 'App lock', 'App lock operation'); diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/oracle_android.sql b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/oracle_android.sql new file mode 100644 index 0000000000..57c71b1af5 --- /dev/null +++ b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/oracle_android.sql @@ -0,0 +1,63 @@ +-- ----------------------------------------------------- +-- Table `AD_DEVICE` +-- ----------------------------------------------------- +CREATE TABLE AD_DEVICE ( + ANDROID_DEVICE_ID VARCHAR2(45) NOT NULL, + GCM_TOKEN VARCHAR2(45) DEFAULT NULL NULL, + DEVICE_INFO VARCHAR2(8000) DEFAULT NULL NULL, + IMEI VARCHAR2(45) DEFAULT NULL NULL, + IMSI VARCHAR2(45) DEFAULT NULL NULL, + OS_VERSION VARCHAR2(45) DEFAULT NULL NULL, + DEVICE_MODEL VARCHAR2(45) DEFAULT NULL NULL, + VENDOR VARCHAR2(45) DEFAULT NULL NULL, + LATITUDE VARCHAR2(45) DEFAULT NULL NULL, + LONGITUDE VARCHAR2(45) DEFAULT NULL NULL, + SERIAL VARCHAR2(45) DEFAULT NULL NULL, + MAC_ADDRESS VARCHAR2(45) DEFAULT NULL NULL, + DEVICE_NAME VARCHAR2(100) DEFAULT NULL NULL, + PRIMARY KEY (ANDROID_DEVICE_ID)); + +-- ----------------------------------------------------- +-- Table `AD_FEATURE` +-- ----------------------------------------------------- +CREATE TABLE AD_FEATURE ( + ID NUMBER(10) NOT NULL, + CODE VARCHAR2(45) NOT NULL, + NAME VARCHAR2(100) NULL, + DESCRIPTION VARCHAR2(200) NULL, + PRIMARY KEY (ID)); + +-- Generate ID using sequence and trigger +CREATE SEQUENCE AD_FEATURE_seq START WITH 1 INCREMENT BY 1; + +CREATE OR REPLACE TRIGGER AD_FEATURE_seq_tr + BEFORE INSERT ON AD_FEATURE FOR EACH ROW + WHEN (NEW.ID IS NULL) +BEGIN + SELECT AD_FEATURE_seq.NEXTVAL INTO :NEW.ID FROM DUAL; +END; +/ + +-- ----------------------------------------------------- +-- TODO remove this later +-- ----------------------------------------------------- +INSERT INTO AD_FEATURE (CODE, NAME, DESCRIPTION) + SELECT 'DEVICE_LOCK', 'Device Lock', 'Lock the device' FROM dual UNION ALL + SELECT 'DEVICE_LOCATION', 'Location', 'Request coordinates of device location' FROM dual UNION ALL + SELECT 'WIFI', 'Wifi', 'Setting up wifi configuration' FROM dual UNION ALL + SELECT 'CAMERA', 'Camera', 'Enable or disable camera' FROM dual UNION ALL + SELECT 'EMAIL', 'Email', 'Configure email settings' FROM dual UNION ALL + SELECT 'DEVICE_MUTE', 'Mute', 'Enable mute in the device' FROM dual UNION ALL + SELECT 'DEVICE_INFO', 'Device Info', 'Request device information' FROM dual UNION ALL + SELECT 'ENTERPRISE_WIPE', 'Enterprise Wipe', 'Remove enterprise applications' FROM dual UNION ALL + SELECT 'CLEAR_PASSWORD', 'Clear Password', 'Clear current password' FROM dual UNION ALL + SELECT 'WIPE_DATA', 'Wipe Data', 'Factory reset the device' FROM dual UNION ALL + SELECT 'APPLICATION_LIST', 'Application List', 'Request list of current installed applications' FROM dual UNION ALL + SELECT 'CHANGE_LOCK_CODE', 'Change Lock-code', 'Change current lock code' FROM dual UNION ALL + SELECT 'INSTALL_APPLICATION', 'Install App', 'Install Enterprise or Market application' FROM dual UNION ALL + SELECT 'UNINSTALL_APPLICATION', 'Uninstall App', 'Uninstall application' FROM dual UNION ALL + SELECT 'BLACKLIST_APPLICATIONS', 'Blacklist app', 'Blacklist applications' FROM dual UNION ALL + SELECT 'ENCRYPT_STORAGE', 'Encrypt storage', 'Encrypt storage' FROM dual UNION ALL + SELECT 'DEVICE_RING', 'Ring', 'Ring the device' FROM dual UNION ALL + SELECT 'PASSCODE_POLICY', 'Password Policy', 'Set passcode policy' FROM dual UNION ALL + SELECT 'NOTIFICATION', 'Message', 'Send message' FROM dual; diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/oracle_ios.sql b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/oracle_ios.sql new file mode 100644 index 0000000000..1354bf577a --- /dev/null +++ b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/oracle_ios.sql @@ -0,0 +1,80 @@ +-- ----------------------------------------------------- +-- Table `IOS_FEATURE` +-- ----------------------------------------------------- +CREATE TABLE IOS_FEATURE ( + FEATURE_ID NUMBER(10) NOT NULL, + CODE VARCHAR2(45) NOT NULL, + NAME VARCHAR2(100) NULL, + DESCRIPTION VARCHAR2(200) NULL, + PRIMARY KEY (FEATURE_ID) ) +; + +-- Generate ID using sequence and trigger +CREATE SEQUENCE IOS_FEATURE_seq START WITH 1 INCREMENT BY 1; + +CREATE OR REPLACE TRIGGER IOS_FEATURE_seq_tr +BEFORE INSERT ON IOS_FEATURE FOR EACH ROW +WHEN (NEW.FEATURE_ID IS NULL) + BEGIN + SELECT IOS_FEATURE_seq.NEXTVAL INTO :NEW.FEATURE_ID FROM DUAL; + END; +/ + + +-- ----------------------------------------------------- +-- Table `IOS_DEVICE` +-- ----------------------------------------------------- +CREATE TABLE IOS_DEVICE ( + MOBILE_DEVICE_ID VARCHAR2(45) NOT NULL, + APNS_PUSH_TOKEN VARCHAR2(100) DEFAULT NULL NULL, + MAGIC_TOKEN VARCHAR2(100) DEFAULT NULL NULL, + MDM_TOKEN VARCHAR2(100) DEFAULT NULL NULL, + UNLOCK_TOKEN VARCHAR2(2000) DEFAULT NULL NULL, + CHALLENGE_TOKEN VARCHAR2(45) DEFAULT NULL NULL, + DEVICE_INFO VARCHAR2(8000) DEFAULT NULL NULL, + SERIAL VARCHAR2(45) DEFAULT NULL NULL, + PRODUCT VARCHAR2(45) DEFAULT NULL NULL, + IMEI VARCHAR2(45) DEFAULT NULL NULL, + VERSION VARCHAR2(45) DEFAULT NULL NULL, + MAC_ADDRESS VARCHAR2(45) DEFAULT NULL NULL, + DEVICE_NAME VARCHAR2(100) DEFAULT NULL NULL, + ICCID VARCHAR2(45) DEFAULT NULL NULL, + LATITUDE VARCHAR2(45) DEFAULT NULL NULL, + LONGITUDE VARCHAR2(45) DEFAULT NULL NULL, + PRIMARY KEY (MOBILE_DEVICE_ID) ) +; + + +-- ----------------------------------------------------- +-- TODO remove this later +-- ----------------------------------------------------- + +INSERT INTO IOS_FEATURE (CODE, NAME, DESCRIPTION) + SELECT 'INSTALL_ENTERPRISE_APPLICATION', 'Install Enterprise App', 'Install Enterprise App' FROM dual UNION ALL + SELECT 'INSTALL_STORE_APPLICATION', 'Install Public App', 'Install Public App' FROM dual UNION ALL + SELECT 'REMOVE_APPLICATION', 'Uninstall App', 'Uninstall App' FROM dual UNION ALL + SELECT 'DEVICE_LOCK', 'Device Lock', 'Device Lock' FROM dual UNION ALL + SELECT 'CELLULAR', 'Cellular', 'Cellular' FROM dual UNION ALL + SELECT 'APN', 'APN', 'APN' FROM dual UNION ALL + SELECT 'RESTRICTION', 'Restrictions', 'Restrictions operation' FROM dual UNION ALL + SELECT 'WIFI', 'Wifi', 'Wifi' FROM dual UNION ALL + SELECT 'DEVICE_INFO', 'Device Info', 'Device info operation' FROM dual UNION ALL + SELECT 'AIR_PLAY', 'Air Play', 'AirPlay operation' FROM dual UNION ALL + SELECT 'LOCATION', 'Location', 'Fetch location' FROM dual UNION ALL + SELECT 'ALARM', 'Alarm', 'Alarm device' FROM dual UNION ALL + SELECT 'APPLICATION_LIST', 'Application list', 'Application list' FROM dual UNION ALL + SELECT 'PROFILE_LIST', 'Profile List', 'Profile list' FROM dual UNION ALL + SELECT 'REMOVE_PROFILE', 'Remove Profile', 'Remove profile' FROM dual UNION ALL + SELECT 'CLEAR_PASSCODE', 'Clear Passcode', 'Clear passcode' FROM dual UNION ALL + SELECT 'CALDAV', 'CalDev', 'Setup CalDav' FROM dual UNION ALL + SELECT 'CALENDAR_SUBSCRIPTION', 'Calendar Subscriptions', 'Calendar subscription' FROM dual UNION ALL + SELECT 'PASSCODE_POLICY', 'Passcode Policy', 'Passcode policy' FROM dual UNION ALL + SELECT 'EMAIL', 'Email', 'Email operation' FROM dual UNION ALL + SELECT 'LDAP', 'LDAP', 'LDAP operation' FROM dual UNION ALL + SELECT 'WEB_CLIP', 'Web Clip', 'Web clip operation' FROM dual UNION ALL + SELECT 'VPN', 'VPN', 'VPN operation' FROM dual UNION ALL + SELECT 'PER_APP_VPN', 'Per App VPN', 'Per app VPN operation' FROM dual UNION ALL + SELECT 'APP_TO_PER_APP_VPN_MAPPING', 'VPN App mapping', 'App to per app VPN mapping operation' FROM dual UNION ALL + SELECT 'ENTERPRISE_WIPE', 'Enterprise Wipe', 'Enterprise wipe operation' FROM dual UNION ALL + SELECT 'APP_LOCK', 'App lock', 'App lock operation' FROM dual UNION ALL + SELECT 'GET_RESTRICTIONS', 'Get restrictions', 'Get restrictions operation' FROM dual; diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/oracle_windows.sql b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/oracle_windows.sql new file mode 100644 index 0000000000..c14e58cee6 --- /dev/null +++ b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/oracle_windows.sql @@ -0,0 +1,72 @@ +-- ----------------------------------------------------- +-- Table `WINDOWS_FEATURE` +-- ----------------------------------------------------- +CREATE TABLE WINDOWS_FEATURE ( + FEATURE_ID NUMBER(10) NOT NULL, + CODE VARCHAR2(45) NOT NULL, + NAME VARCHAR2(100) NULL, + DESCRIPTION VARCHAR2(200) NULL, + PRIMARY KEY (FEATURE_ID)) + ; + +-- Generate ID using sequence and trigger +CREATE SEQUENCE WINDOWS_FEATURE_seq START WITH 1 INCREMENT BY 1; + +CREATE OR REPLACE TRIGGER WINDOWS_FEATURE_seq_tr + BEFORE INSERT ON WINDOWS_FEATURE FOR EACH ROW + WHEN (NEW.FEATURE_ID IS NULL) +BEGIN + SELECT WINDOWS_FEATURE_seq.NEXTVAL INTO :NEW.FEATURE_ID FROM DUAL; +END; +/ + +-- ----------------------------------------------------- +-- Table `WINDOWS_DEVICE` +-- ----------------------------------------------------- +CREATE TABLE WINDOWS_DEVICE ( + MOBILE_DEVICE_ID VARCHAR2(45) NOT NULL, + CHANNEL_URI VARCHAR2(100) DEFAULT NULL NULL, + DEVICE_INFO VARCHAR2(8000) DEFAULT NULL NULL, + IMEI VARCHAR2(45) DEFAULT NULL NULL, + IMSI VARCHAR2(45) DEFAULT NULL NULL, + OS_VERSION VARCHAR2(45) DEFAULT NULL NULL, + DEVICE_MODEL VARCHAR2(45) DEFAULT NULL NULL, + VENDOR VARCHAR2(45) DEFAULT NULL NULL, + LATITUDE VARCHAR2(45) DEFAULT NULL NULL, + LONGITUDE VARCHAR2(45) DEFAULT NULL NULL, + SERIAL VARCHAR2(45) DEFAULT NULL NULL, + MAC_ADDRESS VARCHAR2(45) DEFAULT NULL NULL, + DEVICE_NAME VARCHAR2(100) DEFAULT NULL NULL, + PRIMARY KEY (MOBILE_DEVICE_ID)); + +-- ----------------------------------------------------- +-- TODO remove this later +-- ----------------------------------------------------- +INSERT INTO WINDOWS_FEATURE (CODE, NAME, DESCRIPTION) + SELECT 'INSTALL_ENTERPRISE_APPLICATION', 'Install Enterprise App', 'Install Enterprise App' FROM dual UNION ALL +
('INSTALL_STORE_APPLICATION', 'Install Public App', 'Install Public App'), 
 +('REMOVE_APPLICATION', 'Uninstall App', 'Uninstall App'), +
('DEVICE_LOCK', 'Device Lock', 'Device Lock'), +
('CELLULAR', 'Cellular', 'Cellular'), +
('APN', 'APN', 'APN'), +
('RESTRICTION', 'Restrictions', 'Restrictions operation'), +
('WIFI', 'Wifi', 'Wifi'), +
('DEVICE_INFO', 'Device Info', 'Device info operation'), 
 +('AIR_PLAY', 'Air Play', 'AirPlay operation'), 
 +('LOCATION', 'Location', 'Fetch location'), 
 +('ALARM', 'Alarm', 'Alarm device'), +('APPLICATION_LIST', 'Application list', 'Application list'), +('PROFILE_LIST', 'Profile List', 'Profile list'), +('REMOVE_PROFILE', 'Remove Profile', 'Remove profile'), +('CLEAR_PASSCODE', 'Clear Passcode', 'Clear passcode'), +('CALDAV', 'CalDev', 'Setup CalDav'), +('CALENDAR_SUBSCRIPTION', 'Calendar Subscriptions', 'Calendar subscription'), +('PASSCODE_POLICY', 'Passcode Policy', 'Passcode policy'), +('EMAIL', 'Email', 'Email operation'), +('LDAP', 'LDAP', 'LDAP operation'), +('WEB_CLIP', 'Web Clip', 'Web clip operation'), +('VPN', 'VPN', 'VPN operation'), +('PER_APP_VPN', 'Per App VPN', 'Per app VPN operation'), +('APP_TO_PER_APP_VPN_MAPPING', 'VPN App mapping', 'App to per app VPN mapping operation'), +('ENTERPRISE_WIPE', 'Enterprise Wipe', 'Enterprise wipe operation'), +('APP_LOCK', 'App lock', 'App lock operation'); \ No newline at end of file