forked from community/product-iots
parent
75b4e5ff27
commit
08d2d9d6a7
@ -1,26 +0,0 @@
|
||||
CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE
|
||||
(
|
||||
ID INT(11) auto_increment NOT NULL,
|
||||
NAME VARCHAR(300) NULL DEFAULT NULL,
|
||||
PRIMARY KEY (ID)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS DM_DEVICE
|
||||
(
|
||||
ID INT auto_increment NOT NULL,
|
||||
DESCRIPTION TEXT NULL DEFAULT NULL,
|
||||
NAME VARCHAR(100) NULL DEFAULT NULL,
|
||||
DATE_OF_ENROLLMENT BIGINT NULL DEFAULT NULL,
|
||||
DATE_OF_LAST_UPDATE BIGINT NULL DEFAULT NULL,
|
||||
OWNERSHIP VARCHAR(45) NULL DEFAULT NULL,
|
||||
STATUS VARCHAR(15) NULL DEFAULT NULL,
|
||||
DEVICE_TYPE_ID INT(11) NULL DEFAULT NULL,
|
||||
DEVICE_IDENTIFICATION VARCHAR(300) NULL DEFAULT NULL,
|
||||
OWNER VARCHAR(45) NULL DEFAULT NULL,
|
||||
TENANT_ID INTEGER DEFAULT 0,
|
||||
PRIMARY KEY (ID),
|
||||
CONSTRAINT fk_DM_DEVICE_DM_DEVICE_TYPE2 FOREIGN KEY (DEVICE_TYPE_ID )
|
||||
REFERENCES DM_DEVICE_TYPE (ID ) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||
);
|
||||
-- TO:DO - Remove this INSERT sql statement.
|
||||
Insert into DM_DEVICE_TYPE (NAME) VALUES ('android');
|
@ -1,35 +0,0 @@
|
||||
-- -----------------------------------------------------
|
||||
-- Table `DM_DEVICE_TYPE`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `DM_DEVICE_TYPE` (
|
||||
`ID` INT(11) NOT NULL ,
|
||||
`NAME` VARCHAR(300) NULL DEFAULT NULL ,
|
||||
PRIMARY KEY (`ID`) )
|
||||
ENGINE = InnoDB
|
||||
DEFAULT CHARACTER SET = latin1;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `DM_DEVICE`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `DM_DEVICE` (
|
||||
`ID` VARCHAR(20) NOT NULL ,
|
||||
`DESCRIPTION` TEXT NULL DEFAULT NULL ,
|
||||
`NAME` VARCHAR(100) NULL DEFAULT NULL ,
|
||||
`DATE_OF_ENROLLMENT` DATETIME NULL DEFAULT NULL ,
|
||||
`DATE_OF_LAST_UPDATE` DATETIME NULL DEFAULT NULL ,
|
||||
`OWNERSHIP` VARCHAR(45) NULL DEFAULT NULL ,
|
||||
`STATUS` VARCHAR(15) NULL DEFAULT NULL ,
|
||||
`DEVICE_TYPE_ID` INT(11) NULL DEFAULT NULL ,
|
||||
`DEVICE_IDENTIFICATION` VARCHAR(300) NULL DEFAULT NULL ,
|
||||
`OWNER` VARCHAR(45) NULL DEFAULT NULL ,
|
||||
TENANT_ID INTEGER DEFAULT 0,
|
||||
PRIMARY KEY (`ID`) ,
|
||||
INDEX `fk_DM_DEVICE_DM_DEVICE_TYPE2_idx` (`DEVICE_TYPE_ID` ASC) ,
|
||||
CONSTRAINT `fk_DM_DEVICE_DM_DEVICE_TYPE2`
|
||||
FOREIGN KEY (`DEVICE_TYPE_ID` )
|
||||
REFERENCES `DM_DEVICE_TYPE` (`ID` )
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB
|
||||
DEFAULT CHARACTER SET = latin1;
|
@ -1,82 +0,0 @@
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `MBL_DEVICE`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `MBL_DEVICE` (
|
||||
`MOBILE_DEVICE_ID` VARCHAR(45) NOT NULL ,
|
||||
`REG_ID` 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,
|
||||
PRIMARY KEY (`MOBILE_DEVICE_ID`) );
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `MBL_FEATURE`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `MBL_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`) );
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `MBL_OPERATION`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `MBL_OPERATION` (
|
||||
`OPERATION_ID` INT NOT NULL AUTO_INCREMENT ,
|
||||
`FEATURE_CODE` VARCHAR(45) NOT NULL ,
|
||||
`CREATED_DATE` BIGINT NULL ,
|
||||
PRIMARY KEY (`OPERATION_ID`));
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `MBL_DEVICE_OPERATION_MAPPING`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `MBL_DEVICE_OPERATION_MAPPING` (
|
||||
`DEVICE_ID` VARCHAR(45) NOT NULL ,
|
||||
`OPERATION_ID` INT NOT NULL ,
|
||||
`SENT_DATE` BIGINT NULL ,
|
||||
`RECEIVED_DATE` BIGINT NULL ,
|
||||
PRIMARY KEY (`DEVICE_ID`, `OPERATION_ID`) ,
|
||||
CONSTRAINT `fk_MBL_DEVICE_OPERATION_MBL_DEVICE`
|
||||
FOREIGN KEY (`DEVICE_ID` )
|
||||
REFERENCES `MBL_DEVICE` (`MOBILE_DEVICE_ID` )
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION,
|
||||
CONSTRAINT `fk_MBL_DEVICE_OPERATION_MBL_OPERATION1`
|
||||
FOREIGN KEY (`OPERATION_ID` )
|
||||
REFERENCES `MBL_OPERATION` (`OPERATION_ID` )
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `MBL_OPERATION_PROPERTY`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `MBL_OPERATION_PROPERTY` (
|
||||
`OPERATION_ID` INT NOT NULL ,
|
||||
`PROPERTY` VARCHAR(45) NOT NULL ,
|
||||
`VALUE` TEXT NULL ,
|
||||
PRIMARY KEY (`OPERATION_ID`, `PROPERTY`) ,
|
||||
CONSTRAINT `fk_MBL_OPERATION_PROPERTY_MBL_OPERATION1`
|
||||
FOREIGN KEY (`OPERATION_ID` )
|
||||
REFERENCES `MBL_OPERATION` (`OPERATION_ID` )
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `MBL_FEATURE_PROPERTY`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `MBL_FEATURE_PROPERTY` (
|
||||
`PROPERTY` VARCHAR(45) NOT NULL ,
|
||||
`FEATURE_ID` VARCHAR(45) 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);
|
@ -1,99 +0,0 @@
|
||||
-- -----------------------------------------------------
|
||||
-- Table `MBL_DEVICE`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `MBL_DEVICE` (
|
||||
`MOBILE_DEVICE_ID` VARCHAR(45) NOT NULL,
|
||||
`REG_ID` 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,
|
||||
PRIMARY KEY (`MOBILE_DEVICE_ID`))
|
||||
ENGINE = InnoDB;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `MBL_FEATURE`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `MBL_FEATURE` (
|
||||
`FEATURE_ID` INT NOT NULL AUTO_INCREMENT,
|
||||
`CODE` VARCHAR(45) NULL,
|
||||
`NAME` VARCHAR(100) NULL,
|
||||
`DESCRIPTION` VARCHAR(200) NULL,
|
||||
PRIMARY KEY (`FEATURE_ID`))
|
||||
ENGINE = InnoDB;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `MBL_OPERATION`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `MBL_OPERATION` (
|
||||
`OPERATION_ID` INT NOT NULL AUTO_INCREMENT,
|
||||
`FEATURE_CODE` VARCHAR(45) NULL,
|
||||
`CREATED_DATE` INT NULL,
|
||||
PRIMARY KEY (`OPERATION_ID`))
|
||||
ENGINE = InnoDB;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `MBL_DEVICE_OPERATION_MAPING`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `MBL_DEVICE_OPERATION_MAPPING` (
|
||||
`DEVICE_ID` VARCHAR(45) NOT NULL,
|
||||
`OPERATION_ID` INT NOT NULL,
|
||||
`SENT_DATE` INT NULL,
|
||||
`RECEIVED_DATE` INT NULL,
|
||||
PRIMARY KEY (`DEVICE_ID`, `OPERATION_ID`),
|
||||
INDEX `fk_MBL_DEVICE_OPERATION_MBL_OPERATION1_idx` (`OPERATION_ID` ASC),
|
||||
CONSTRAINT `fk_MBL_DEVICE_OPERATION_MBL_DEVICE`
|
||||
FOREIGN KEY (`DEVICE_ID`)
|
||||
REFERENCES `MBL_DEVICE` (`MOBILE_DEVICE_ID`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION,
|
||||
CONSTRAINT `fk_MBL_DEVICE_OPERATION_MBL_OPERATION1`
|
||||
FOREIGN KEY (`OPERATION_ID`)
|
||||
REFERENCES `MBL_OPERATION` (`OPERATION_ID`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `MBL_OPERATION_PROPERTY`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `MBL_OPERATION_PROPERTY` (
|
||||
`OPERATION_PROPERTY_ID` INT NOT NULL AUTO_INCREMENT,
|
||||
`OPERATION_ID` INT NULL,
|
||||
`PROPERTY_ID` INT NULL,
|
||||
`VALUE` TEXT NULL,
|
||||
PRIMARY KEY (`OPERATION_PROPERTY_ID`),
|
||||
INDEX `fk_MBL_OPERATION_PROPERTY_MBL_OPERATION1_idx` (`OPERATION_ID` ASC),
|
||||
CONSTRAINT `fk_MBL_OPERATION_PROPERTY_MBL_OPERATION1`
|
||||
FOREIGN KEY (`OPERATION_ID`)
|
||||
REFERENCES `MBL_OPERATION` (`OPERATION_ID`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `MBL_FEATURE_PROPERTY`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `MBL_FEATURE_PROPERTY` (
|
||||
`PROPERTY_ID` INT NOT NULL AUTO_INCREMENT,
|
||||
`PROPERTY` VARCHAR(100) NULL,
|
||||
`FEATURE_ID` VARCHAR(45) NULL,
|
||||
PRIMARY KEY (`PROPERTY_ID`),
|
||||
INDEX `fk_MBL_FEATURE_PROPERTY_MBL_FEATURE1_idx` (`FEATURE_ID` ASC),
|
||||
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;
|
||||
|
||||
|
||||
|
Loading…
Reference in new issue