Adding postgreSQL and Oracle schemas for plugin specific datastores and refactoring existing schemas to be consistent across that of all available plugin types
parent
c47ace254c
commit
b5548f5744
@ -0,0 +1,30 @@
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `AD_DEVICE`
|
||||
-- -----------------------------------------------------
|
||||
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,
|
||||
`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 IF NOT EXISTS `AD_FEATURE` (
|
||||
`ID` INT NOT NULL AUTO_INCREMENT,
|
||||
`CODE` VARCHAR(45) NOT NULL,
|
||||
`NAME` VARCHAR(100) NULL,
|
||||
`DESCRIPTION` VARCHAR(200) NULL,
|
||||
PRIMARY KEY (`ID`));
|
||||
|
@ -0,0 +1,49 @@
|
||||
-- -----------------------------------------------------
|
||||
-- Table `AD_DEVICE`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE AD_DEVICE (
|
||||
DEVICE_ID VARCHAR(45) NOT NULL ,
|
||||
DEVICE_INFO VARCHAR(500) DEFAULT NULL,
|
||||
GCM_TOKEN VARCHAR(45) DEFAULT NULL,
|
||||
IMEI VARCHAR(45) DEFAULT NULL,
|
||||
IMSI VARCHAR(45) DEFAULT NULL,
|
||||
OS_VERSION VARCHAR(45) DEFAULT NULL,
|
||||
DEVICE_MODEL VARCHAR(45) DEFAULT NULL,
|
||||
VENDOR VARCHAR(45) DEFAULT NULL,
|
||||
LATITUDE VARCHAR(45) DEFAULT NULL,
|
||||
LONGITUDE VARCHAR(45) DEFAULT NULL,
|
||||
SERIAL VARCHAR(45) DEFAULT NULL,
|
||||
MAC_ADDRESS VARCHAR(45) DEFAULT NULL,
|
||||
DEVICE_NAME VARCHAR(100) DEFAULT NULL,
|
||||
PRIMARY KEY (DEVICE_ID)
|
||||
);
|
||||
/
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `AD_FEATURE`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE AD_FEATURE (
|
||||
ID INT NOT NULL,
|
||||
CODE VARCHAR(45) NOT NULL,
|
||||
NAME VARCHAR(100) NOT NULL,
|
||||
DESCRIPTION VARCHAR(200) DEFAULT NULL,
|
||||
PRIMARY KEY (ID)
|
||||
);
|
||||
/
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Sequence `AD_FEATURE_ID_INC_SEQ`
|
||||
-- -----------------------------------------------------
|
||||
CREATE SEQUENCE AD_FEATURE_ID_INC_SEQ START WITH 1 INCREMENT BY 1 NOCACHE;
|
||||
/
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Trigger `AD_FEATURE_ID_INC_TRIG`
|
||||
-- -----------------------------------------------------
|
||||
CREATE OR REPLACE TRIGGER AD_FEATURE_ID_INC_TRIG
|
||||
BEFORE INSERT ON AD_FEATURE
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
SELECT AD_FEATURE_ID_INC_SEQ.NEXTVAL INTO :NEW.ID FROM DUAL;
|
||||
END;
|
||||
/
|
@ -0,0 +1,30 @@
|
||||
-- -----------------------------------------------------
|
||||
-- Table AD_DEVICE
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS AD_DEVICE (
|
||||
ID VARCHAR(45) NOT NULL ,
|
||||
DEVICE_INFO VARCHAR(500) NULL DEFAULT NULL,
|
||||
GCM_TOKEN VARCHAR(45) 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 (ID)
|
||||
);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table AD_FEATURE
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS AD_FEATURE (
|
||||
ID INT NOT NULL AUTO_INCREMENT,
|
||||
CODE VARCHAR(45) NOT NULL,
|
||||
NAME VARCHAR(100) NULL,
|
||||
DESCRIPTION VARCHAR(200) NULL,
|
||||
PRIMARY KEY (ID)
|
||||
);
|
@ -1,56 +0,0 @@
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `AD_DEVICE`
|
||||
-- -----------------------------------------------------
|
||||
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,
|
||||
`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 IF NOT EXISTS `AD_FEATURE` (
|
||||
`ID` INT NOT NULL AUTO_INCREMENT,
|
||||
`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,33 @@
|
||||
-- -----------------------------------------------------
|
||||
-- Table `IOS_DEVICE`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `IOS_DEVICE` (
|
||||
`DEVICE_ID` VARCHAR(45) NOT NULL,
|
||||
`APNS_PUSH_TOKEN` VARCHAR(100) DEFAULT NULL,
|
||||
`MAGIC_TOKEN` VARCHAR(100) DEFAULT NULL,
|
||||
`MDM_TOKEN` VARCHAR(100) DEFAULT NULL,
|
||||
`UNLOCK_TOKEN` VARCHAR(2000) DEFAULT NULL,
|
||||
`CHALLENGE_TOKEN` VARCHAR(45) DEFAULT NULL,
|
||||
`DEVICE_INFO` VARCHAR(8000) DEFAULT NULL,
|
||||
`SERIAL` VARCHAR(45) DEFAULT NULL,
|
||||
`PRODUCT` VARCHAR(45) DEFAULT NULL,
|
||||
`IMEI` VARCHAR(45) DEFAULT NULL,
|
||||
`VERSION` VARCHAR(45) DEFAULT NULL,
|
||||
`MAC_ADDRESS` VARCHAR(45) DEFAULT NULL,
|
||||
`DEVICE_NAME` VARCHAR(100) DEFAULT NULL,
|
||||
`ICCID` VARCHAR(45) DEFAULT NULL,
|
||||
`LATITUDE` VARCHAR(45) DEFAULT NULL,
|
||||
`LONGITUDE` VARCHAR(45) DEFAULT NULL,
|
||||
PRIMARY KEY (`DEVICE_ID`)
|
||||
);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `IOS_FEATURE`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `IOS_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`)
|
||||
);
|
@ -0,0 +1,51 @@
|
||||
-- -----------------------------------------------------
|
||||
-- Table `IOS_DEVICE`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IOS_DEVICE (
|
||||
DEVICE_ID VARCHAR(45) NOT NULL,
|
||||
APNS_PUSH_TOKEN VARCHAR(100) DEFAULT NULL,
|
||||
MAGIC_TOKEN VARCHAR(100) DEFAULT NULL,
|
||||
MDM_TOKEN VARCHAR(100) DEFAULT NULL,
|
||||
UNLOCK_TOKEN VARCHAR(2000) DEFAULT NULL,
|
||||
CHALLENGE_TOKEN VARCHAR(45) DEFAULT NULL,
|
||||
DEVICE_INFO VARCHAR(8000) DEFAULT NULL,
|
||||
SERIAL VARCHAR(45) DEFAULT NULL,
|
||||
PRODUCT VARCHAR(45) DEFAULT NULL,
|
||||
IMEI VARCHAR(45) DEFAULT NULL,
|
||||
VERSION VARCHAR(45) DEFAULT NULL,
|
||||
MAC_ADDRESS VARCHAR(45) DEFAULT NULL,
|
||||
DEVICE_NAME VARCHAR(100) DEFAULT NULL,
|
||||
ICCID VARCHAR(45) DEFAULT NULL,
|
||||
LATITUDE VARCHAR(45) DEFAULT NULL,
|
||||
LONGITUDE VARCHAR(45) DEFAULT NULL,
|
||||
PRIMARY KEY (DEVICE_ID)
|
||||
);
|
||||
/
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `IOS_FEATURE`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IOS_FEATURE (
|
||||
ID INT NOT NULL,
|
||||
CODE VARCHAR(45) NOT NULL,
|
||||
NAME VARCHAR(100) NOT NULL,
|
||||
DESCRIPTION VARCHAR(200) NULL,
|
||||
PRIMARY KEY (ID)
|
||||
);
|
||||
/
|
||||
|
||||
-- Sequence `IOS_FEATURE_ID_INC_SEQ`
|
||||
-- -----------------------------------------------------
|
||||
CREATE SEQUENCE IOS_FEATURE_ID_INC_SEQ START WITH 1 INCREMENT BY 1 NOCACHE;
|
||||
/
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Trigger `IOS_FEATURE_ID_INC_TRIG`
|
||||
-- -----------------------------------------------------
|
||||
CREATE OR REPLACE TRIGGER IOS_FEATURE_ID_INC_TRIG
|
||||
BEFORE INSERT ON IOS_FEATURE
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
SELECT IOS_FEATURE_ID_INC_SEQ.NEXTVAL INTO :NEW.ID FROM DUAL;
|
||||
END;
|
||||
/
|
@ -0,0 +1,33 @@
|
||||
-- -----------------------------------------------------
|
||||
-- Table IOS_FEATURE
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS IOS_FEATURE (
|
||||
ID SERIAL NOT NULL,
|
||||
CODE VARCHAR(45) NOT NULL,
|
||||
NAME VARCHAR(100) NULL,
|
||||
DESCRIPTION VARCHAR(200) NULL,
|
||||
PRIMARY KEY (ID)
|
||||
);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table IOS_DEVICE
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS IOS_DEVICE (
|
||||
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 (DEVICE_ID)
|
||||
);
|
@ -1,52 +0,0 @@
|
||||
-- -----------------------------------------------------
|
||||
-- Table `MBL_DEVICE`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `MBL_DEVICE` (
|
||||
`MOBILE_DEVICE_ID` VARCHAR(45) NOT NULL,
|
||||
`PUSH_TOKEN` VARCHAR(45) 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,
|
||||
`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,
|
||||
PRIMARY KEY (`MOBILE_DEVICE_ID`))
|
||||
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
|
||||
-- -----------------------------------------------------
|
||||
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');
|
||||
|
@ -0,0 +1,30 @@
|
||||
-- -----------------------------------------------------
|
||||
-- Table `WIN_DEVICE`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `WIN_DEVICE` (
|
||||
`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 (`DEVICE_ID`)
|
||||
);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `WIN_FEATURE`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `WIN_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`)
|
||||
);
|
@ -0,0 +1,48 @@
|
||||
-- -----------------------------------------------------
|
||||
-- Table `WIN_DEVICE`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `WIN_DEVICE` (
|
||||
`DEVICE_ID` VARCHAR(45) NOT NULL,
|
||||
`PUSH_TOKEN` VARCHAR(45) 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,
|
||||
`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,
|
||||
PRIMARY KEY (`DEVICE_ID`))
|
||||
ENGINE = InnoDB;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `WIN_FEATURE`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `WIN_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 `WIN_FEATURE_PROPERTY`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `WIN_FEATURE_PROPERTY` (
|
||||
`PROPERTY` VARCHAR(45) NOT NULL ,
|
||||
`FEATURE_ID` INT NOT NULL ,
|
||||
PRIMARY KEY (`PROPERTY`),
|
||||
CONSTRAINT `fk_WIN_FEATURE_PROPERTY_WIN_FEATURE1`
|
||||
FOREIGN KEY (`FEATURE_ID`)
|
||||
REFERENCES `WIN_FEATURE` (`FEATURE_ID`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB;
|
||||
|
||||
|
@ -0,0 +1,64 @@
|
||||
-- -----------------------------------------------------
|
||||
-- Table `WIN_DEVICE`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE WIN_DEVICE (
|
||||
DEVICE_ID VARCHAR(45) NOT NULL,
|
||||
PUSH_TOKEN VARCHAR(45) DEFAULT NULL,
|
||||
IMEI VARCHAR(45) DEFAULT NULL,
|
||||
IMSI VARCHAR(45) DEFAULT NULL,
|
||||
OS_VERSION VARCHAR(45) DEFAULT NULL,
|
||||
DEVICE_MODEL VARCHAR(45) DEFAULT NULL,
|
||||
VENDOR VARCHAR(45) DEFAULT NULL,
|
||||
LATITUDE VARCHAR(45) DEFAULT NULL,
|
||||
LONGITUDE VARCHAR(45) DEFAULT NULL,
|
||||
CHALLENGE VARCHAR(45) DEFAULT NULL,
|
||||
TOKEN VARCHAR(50) DEFAULT NULL,
|
||||
UNLOCK_TOKEN VARCHAR(2000) DEFAULT NULL,
|
||||
SERIAL VARCHAR(45) DEFAULT NULL,
|
||||
PRIMARY KEY (DEVICE_ID)
|
||||
);
|
||||
/
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `WIN_FEATURE`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE WIN_FEATURE (
|
||||
ID INT NOT NULL,
|
||||
DEVICE_TYPE VARCHAR(45) NOT NULL,
|
||||
CODE VARCHAR(45) NOT NULL,
|
||||
NAME VARCHAR(100) NOT NULL,
|
||||
DESCRIPTION VARCHAR(200) NULL,
|
||||
PRIMARY KEY (ID)
|
||||
);
|
||||
/
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `WIN_FEATURE_PROPERTY`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE WIN_FEATURE_PROPERTY (
|
||||
PROPERTY VARCHAR(45) NOT NULL,
|
||||
FEATURE_ID INT NOT NULL,
|
||||
PRIMARY KEY (PROPERTY),
|
||||
CONSTRAINT fk_WIN_FEATURE_PROPERTY_WIN_FEATURE1
|
||||
FOREIGN KEY (FEATURE_ID)
|
||||
REFERENCES WIN_FEATURE (FEATURE_ID)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION);
|
||||
/
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Sequence `WIN_FEATURE_ID_INC_SEQ`
|
||||
-- -----------------------------------------------------
|
||||
CREATE SEQUENCE WIN_FEATURE_ID_INC_SEQ START WITH 1 INCREMENT BY 1 NOCACHE;
|
||||
/
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Trigger `WIN_FEATURE_ID_INC_TRIG`
|
||||
-- -----------------------------------------------------
|
||||
CREATE OR REPLACE TRIGGER WIN_FEATURE_ID_INC_TRIG
|
||||
BEFORE INSERT ON WIN_FEATURE
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
SELECT WIN_FEATURE_ID_INC_SEQ.NEXTVAL INTO :NEW.ID FROM DUAL;
|
||||
END;
|
||||
/
|
@ -0,0 +1,45 @@
|
||||
-- -----------------------------------------------------
|
||||
-- Table WIN_DEVICE
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS WIN_DEVICE (
|
||||
DEVICE_ID VARCHAR(45) NOT NULL,
|
||||
PUSH_TOKEN VARCHAR(45) 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,
|
||||
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,
|
||||
PRIMARY KEY (DEVICE_ID)
|
||||
);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table WIN_FEATURE
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS WIN_FEATURE (
|
||||
ID SERIAL NOT NULL,
|
||||
DEVICE_TYPE VARCHAR(45) NOT NULL,
|
||||
CODE VARCHAR(45) NULL,
|
||||
NAME VARCHAR(100) NULL,
|
||||
DESCRIPTION VARCHAR(200) NULL,
|
||||
PRIMARY KEY (ID)
|
||||
);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `WIN_FEATURE_PROPERTY`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS WIN_FEATURE_PROPERTY (
|
||||
PROPERTY VARCHAR(45) NOT NULL ,
|
||||
FEATURE_ID INT NOT NULL ,
|
||||
PRIMARY KEY (PROPERTY),
|
||||
CONSTRAINT fk_WIN_FEATURE_PROPERTY_WIN_FEATURE1
|
||||
FOREIGN KEY (FEATURE_ID)
|
||||
REFERENCES WIN_FEATURE (ID)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION
|
||||
);
|
Loading…
Reference in new issue