Added missing sql DB Scripts

revert-dabc3590
Dileesha Rajapakse 9 years ago
parent 297c7d1e96
commit c2bd221f64

@ -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,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');

@ -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,
@ -39,19 +38,18 @@ CREATE TABLE IF NOT EXISTS `IOS_FEATURE` (
-- TODO remove this later
-- -----------------------------------------------------
INSERT INTO IOS_FEATURE (CODE, NAME, DESCRIPTION)
VALUES
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'),
('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'),
('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'),

@ -37,19 +37,18 @@ CREATE TABLE IF NOT EXISTS `WINDOWS_FEATURE` (
-- TODO remove this later
-- -----------------------------------------------------
INSERT INTO WINDOWS_FEATURE (CODE, NAME, DESCRIPTION)
VALUES
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'),
('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'),
('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'),

@ -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;

@ -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');
Loading…
Cancel
Save