forked from community/device-mgt-plugins
Merge pull request #14 from dilee/master
Added android sql scripts and refactored iOS and Windows sql scriptsrevert-dabc3590
commit
2f86f3064e
@ -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');
|
@ -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');
|
@ -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;
|
@ -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;
|
Loading…
Reference in new issue