revert-70aa11f8
Geeth Munasinghe 10 years ago
commit 9004f2cd36

@ -1,11 +1,88 @@
CREATE TABLE IF NOT EXISTS MBL_DEVICE
(
MOBILE_DEVICE_ID VARCHAR(45) NOT NULL,
REG_ID VARCHAR(45) NOT NULL,
IMEI VARCHAR(45) NOT NULL,
IMSI VARCHAR(45),
OS_VERSION VARCHAR(45) NOT NULL,
DEVICE_MODEL VARCHAR(45) NOT NULL,
VENDOR VARCHAR(45) NOT NULL,
PRIMARY KEY (MOBILE_DEVICE_ID)
);
-- -----------------------------------------------------
-- 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 ,
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) 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) NULL ,
`CREATED_DATE` INT NULL ,
PRIMARY KEY (`OPERATION_ID`) ,
CONSTRAINT `fk_MBL_OPERATION_MBL_FEATURES1`
FOREIGN KEY (`FEATURE_CODE` )
REFERENCES `MBL_FEATURE` (`CODE` )
ON DELETE NO ACTION
ON UPDATE NO ACTION);
-- -----------------------------------------------------
-- Table `MBL_DEVICE_OPERATION_MAPING`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `MBL_DEVICE_OPERATION_MAPING` (
`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`) ,
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_PROPERTY_ID` INT NOT NULL AUTO_INCREMENT ,
`OPERATION_ID` INT NULL ,
`PROPERTY_ID` INT NULL ,
`VALUE` TEXT NULL ,
PRIMARY KEY (`OPERATION_PROPERTY_ID`) ,
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_ID` INT NOT NULL AUTO_INCREMENT ,
`PROPERTY` VARCHAR(100) NULL ,
`FEATURE_ID` VARCHAR(45) NULL ,
PRIMARY KEY (`PROPERTY_ID`) ,
CONSTRAINT `fk_MBL_FEATURE_PROPERTY_MBL_FEATURE1`
FOREIGN KEY (`FEATURE_ID` )
REFERENCES `MBL_FEATURE` (`FEATURE_ID` )
ON DELETE NO ACTION
ON UPDATE NO ACTION);

@ -0,0 +1,88 @@
-- -----------------------------------------------------
-- 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 ,
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) 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) NULL ,
`CREATED_DATE` INT NULL ,
PRIMARY KEY (`OPERATION_ID`) ,
CONSTRAINT `fk_MBL_OPERATION_MBL_FEATURES1`
FOREIGN KEY (`FEATURE_CODE` )
REFERENCES `MBL_FEATURE` (`CODE` )
ON DELETE NO ACTION
ON UPDATE NO ACTION);
-- -----------------------------------------------------
-- Table `MBL_DEVICE_OPERATION_MAPING`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `MBL_DEVICE_OPERATION_MAPING` (
`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`) ,
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_PROPERTY_ID` INT NOT NULL AUTO_INCREMENT ,
`OPERATION_ID` INT NULL ,
`PROPERTY_ID` INT NULL ,
`VALUE` TEXT NULL ,
PRIMARY KEY (`OPERATION_PROPERTY_ID`) ,
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_ID` INT NOT NULL AUTO_INCREMENT ,
`PROPERTY` VARCHAR(100) NULL ,
`FEATURE_ID` VARCHAR(45) NULL ,
PRIMARY KEY (`PROPERTY_ID`) ,
CONSTRAINT `fk_MBL_FEATURE_PROPERTY_MBL_FEATURE1`
FOREIGN KEY (`FEATURE_ID` )
REFERENCES `MBL_FEATURE` (`FEATURE_ID` )
ON DELETE NO ACTION
ON UPDATE NO ACTION);

@ -13,3 +13,91 @@ CREATE TABLE IF NOT EXISTS `MBL_DEVICE` (
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`) ,
INDEX `fk_MBL_OPERATION_MBL_FEATURES1_idx` (`FEATURE_CODE` ASC) ,
CONSTRAINT `fk_MBL_OPERATION_MBL_FEATURES1`
FOREIGN KEY (`FEATURE_CODE` )
REFERENCES `MBL_FEATURE` (`CODE` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `MBL_DEVICE_OPERATION_MAPING`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `MBL_DEVICE_OPERATION_MAPING` (
`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;

@ -0,0 +1,15 @@
-- -----------------------------------------------------
-- Table `MBL_DEVICE`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `MBL_DEVICE` (
`MOBILE_DEVICE_ID` VARCHAR(45) NOT NULL,
`REG_ID` VARCHAR(45) NULL,
`IMEI` VARCHAR(45) NULL,
`IMSI` VARCHAR(45) NULL,
`OS_VERSION` VARCHAR(45) NULL,
`DEVICE_MODEL` VARCHAR(45) NULL,
`VENDOR` VARCHAR(45) NULL,
PRIMARY KEY (`MOBILE_DEVICE_ID`))
ENGINE = InnoDB;
Loading…
Cancel
Save