forked from community/device-mgt-core
parent
ff211708a1
commit
345c786328
@ -1,44 +1,227 @@
|
|||||||
CREATE TABLE IF NOT EXISTS APPM_APPLICATION_TYPE (
|
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
|
||||||
ID INTEGER AUTO_INCREMENT,
|
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
|
||||||
NAME VARCHAR (255),
|
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
|
||||||
DESCRIPTION TEXT,
|
|
||||||
CODE VARCHAR (255),
|
-- -----------------------------------------------------
|
||||||
PARAMTERS LONGTEXT,
|
-- Schema WSO2DM_APPM_DB
|
||||||
PRIMARY KEY (ID)
|
-- -----------------------------------------------------
|
||||||
)ENGINE INNODB;
|
|
||||||
|
-- -----------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS APPM_APPLICATION_CATEGORY (
|
-- Table `APPM_APPLICATION_PLATFORM`
|
||||||
ID INTEGER AUTO_INCREMENT,
|
-- -----------------------------------------------------
|
||||||
NAME VARCHAR (255),
|
CREATE TABLE IF NOT EXISTS `APPM_APPLICATION_PLATFORM` (
|
||||||
DESCRIPTION TEXT,
|
`ID` INT NOT NULL,
|
||||||
PRIMARY KEY (ID)
|
`NAME` VARCHAR(100) NOT NULL,
|
||||||
)ENGINE INNODB;
|
`DESCRIPTION` TEXT NULL,
|
||||||
|
`CODE` VARCHAR(100) NOT NULL,
|
||||||
|
`ICON_NAME` VARCHAR(100) NULL,
|
||||||
CREATE TABLE IF NOT EXISTS APPM_APPLICATION (
|
`PROPERTIES` LONGTEXT NOT NULL,
|
||||||
ID INTEGER AUTO_INCREMENT,
|
`PUBLISHED` TINYINT NULL,
|
||||||
NAME VARCHAR (255),
|
PRIMARY KEY (`ID`))
|
||||||
UUID VARCHAR (255),
|
ENGINE = InnoDB
|
||||||
DESCRIPTION MEDIUMTEXT,
|
COMMENT = 'This table contains the data related to the application platform';
|
||||||
ICON_NAME VARCHAR (255),
|
|
||||||
BANNER_NAME VARCHAR (255),
|
|
||||||
VIDEO_NAME VARCHAR (255),
|
-- -----------------------------------------------------
|
||||||
SCREENSHOTS TEXT,
|
-- Table `APPM_APPLICATION_CATEGORY`
|
||||||
TAGS TEXT,
|
-- -----------------------------------------------------
|
||||||
APPLICATION_TYPE_ID INTEGER,
|
CREATE TABLE IF NOT EXISTS `APPM_APPLICATION_CATEGORY` (
|
||||||
CATEGORY_ID INTEGER,
|
`ID` INT NOT NULL AUTO_INCREMENT,
|
||||||
CREATED_AT DATETIME,
|
`NAME` VARCHAR(100) NOT NULL,
|
||||||
MODIFIED_AT DATETIME,
|
`DESCRIPTION` TEXT NULL,
|
||||||
PRIMARY KEY (ID),
|
`TENANT_ID` INT NULL,
|
||||||
FOREIGN KEY (CATEGORY_ID) REFERENCES APPM_APPLICATION_CATEGORY(ID),
|
`PUBLISHED` TINYINT NULL,
|
||||||
FOREIGN KEY (APPLICATION_TYPE_ID) REFERENCES APPM_APPLICATION_TYPE(ID)
|
PRIMARY KEY (`ID`))
|
||||||
)ENGINE INNODB;
|
ENGINE = InnoDB
|
||||||
|
COMMENT = 'This table contains the data related to the application category';
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS APPM_APPLICATION_PROPERTIES (
|
|
||||||
PROP_KEY VARCHAR (255),
|
-- -----------------------------------------------------
|
||||||
PROP_VAL MEDIUMTEXT,
|
-- Table `APPM_APPLICATION`
|
||||||
APPLICATION_ID INTEGER,
|
-- -----------------------------------------------------
|
||||||
PRIMARY KEY (APPLICATION_ID, PROP_KEY),
|
CREATE TABLE IF NOT EXISTS `APPM_APPLICATION` (
|
||||||
FOREIGN KEY (APPLICATION_ID) REFERENCES APPM_APPLICATION(ID)
|
`ID` INT NOT NULL AUTO_INCREMENT,
|
||||||
)ENGINE INNODB;
|
`UUID` VARCHAR(100) NOT NULL,
|
||||||
|
`NAME` VARCHAR(100) NOT NULL,
|
||||||
|
`DESCRIPTION` TEXT NULL,
|
||||||
|
`ICON_NAME` VARCHAR(100) NULL,
|
||||||
|
`BANNER_NAME` VARCHAR(100) NULL,
|
||||||
|
`VIDEO_NAME` VARCHAR(100) NULL,
|
||||||
|
`SCREENSHOTS` TEXT NULL,
|
||||||
|
`CREATED_AT` DATETIME NULL,
|
||||||
|
`MODIFIED_AT` DATETIME NULL,
|
||||||
|
`PUBLISHED` TINYINT NULL,
|
||||||
|
`APPLICATION_CATEGORY_ID` INT NOT NULL,
|
||||||
|
PRIMARY KEY (`ID`, `APPLICATION_CATEGORY_ID`),
|
||||||
|
UNIQUE INDEX `UUID_UNIQUE` (`UUID` ASC),
|
||||||
|
INDEX `FK_APPLICATION_APPLICATION_CATEGORY` (`APPLICATION_CATEGORY_ID` ASC),
|
||||||
|
CONSTRAINT `FK_APPLICATION_APPLICATION_CATEGORY`
|
||||||
|
FOREIGN KEY (`APPLICATION_CATEGORY_ID`)
|
||||||
|
REFERENCES `APPM_APPLICATION_CATEGORY` (`ID`)
|
||||||
|
ON DELETE NO ACTION
|
||||||
|
ON UPDATE NO ACTION)
|
||||||
|
ENGINE = InnoDB
|
||||||
|
COMMENT = 'This table contains the data related to the applications';
|
||||||
|
|
||||||
|
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
-- Table `APPM_APPLICATION_PROPERTY`
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
CREATE TABLE IF NOT EXISTS `APPM_APPLICATION_PROPERTY` (
|
||||||
|
`PROP_KEY` VARCHAR(255) NOT NULL,
|
||||||
|
`PROP_VAL` TEXT NULL,
|
||||||
|
`APPLICATION_ID` INT NOT NULL,
|
||||||
|
PRIMARY KEY (`PROP_KEY`, `APPLICATION_ID`),
|
||||||
|
INDEX `FK_APPLICATION_PROPERTY_APPLICATION` (`APPLICATION_ID` ASC),
|
||||||
|
CONSTRAINT `FK_APPLICATION_PROPERTY_APPLICATION`
|
||||||
|
FOREIGN KEY (`APPLICATION_ID`)
|
||||||
|
REFERENCES `APPM_APPLICATION` (`ID`)
|
||||||
|
ON DELETE NO ACTION
|
||||||
|
ON UPDATE NO ACTION)
|
||||||
|
ENGINE = InnoDB
|
||||||
|
COMMENT = 'This table contains the data related to the properties that related to the application';
|
||||||
|
|
||||||
|
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
-- Table `APPM_APPLICATION_RELEASE`
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
CREATE TABLE IF NOT EXISTS `APPM_APPLICATION_RELEASE` (
|
||||||
|
`ID` INT NOT NULL AUTO_INCREMENT,
|
||||||
|
`VERSION_ID` INT NOT NULL,
|
||||||
|
`VERSION_NAME` VARCHAR(100) NOT NULL,
|
||||||
|
`RESOURCE` TEXT NULL,
|
||||||
|
`RELEASE_CHANNEL` VARCHAR(50) NULL,
|
||||||
|
`RELEASE_DETAILS` TEXT NULL,
|
||||||
|
`CREATED_AT` DATETIME NULL,
|
||||||
|
`APPM_APPLICATION_ID` INT NOT NULL,
|
||||||
|
`LIFECYCLE_STATE` VARCHAR(50) NULL,
|
||||||
|
`LIECYCLE_STATE_MODIFIED_BY` VARCHAR(45) NULL,
|
||||||
|
`LIFECYCLE_STATE_MODIFIED_AT` DATETIME NULL,
|
||||||
|
PRIMARY KEY (`ID`, `APPM_APPLICATION_ID`),
|
||||||
|
INDEX `FK_APPLICATION_VERSION_APPLICATION` (`APPM_APPLICATION_ID` ASC),
|
||||||
|
CONSTRAINT `FK_APPLICATION_VERSION_APPLICATION`
|
||||||
|
FOREIGN KEY (`APPM_APPLICATION_ID`)
|
||||||
|
REFERENCES `APPM_APPLICATION` (`ID`)
|
||||||
|
ON DELETE NO ACTION
|
||||||
|
ON UPDATE NO ACTION)
|
||||||
|
ENGINE = InnoDB
|
||||||
|
COMMENT = 'This table contains the data related to the application releases';
|
||||||
|
|
||||||
|
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
-- Table `APPM_RELEASE_PROPERTY`
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
CREATE TABLE IF NOT EXISTS `APPM_RELEASE_PROPERTY` (
|
||||||
|
`PROP_KEY` VARCHAR(255) NOT NULL,
|
||||||
|
`PROP_VALUE` TEXT NULL,
|
||||||
|
`APPM_APPLICATION_RELEASE_ID` INT NOT NULL,
|
||||||
|
PRIMARY KEY (`PROP_KEY`, `APPM_APPLICATION_RELEASE_ID`),
|
||||||
|
INDEX `FK_RELEASE_PROPERTY_APPLICATION_RELEASE` (`APPM_APPLICATION_RELEASE_ID` ASC),
|
||||||
|
CONSTRAINT `FK_RELEASE_PROPERTY_APPLICATION_RELEASE`
|
||||||
|
FOREIGN KEY (`APPM_APPLICATION_RELEASE_ID`)
|
||||||
|
REFERENCES `APPM_APPLICATION_RELEASE` (`ID`)
|
||||||
|
ON DELETE NO ACTION
|
||||||
|
ON UPDATE NO ACTION)
|
||||||
|
ENGINE = InnoDB
|
||||||
|
COMMENT = 'This table contains the data related to the properties that related to the application release';
|
||||||
|
|
||||||
|
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
-- Table `APPM_APPLICATION_SUBSCRIPTION`
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
CREATE TABLE IF NOT EXISTS `APPM_APPLICATION_SUBSCRIPTION` (
|
||||||
|
`APPLICATION_ID` INT NOT NULL,
|
||||||
|
`SUBSCRIPTION_TYPE` VARCHAR(50) NOT NULL,
|
||||||
|
`SUBSCRIPTION_VALUE` VARCHAR(255) NOT NULL,
|
||||||
|
`CREATED_AT` DATETIME NULL,
|
||||||
|
PRIMARY KEY (`APPLICATION_ID`, `SUBSCRIPTION_TYPE`, `SUBSCRIPTION_VALUE`),
|
||||||
|
CONSTRAINT `FK_APPLICATION_INSTALLATION_APPLICATION`
|
||||||
|
FOREIGN KEY (`APPLICATION_ID`)
|
||||||
|
REFERENCES `APPM_APPLICATION` (`ID`)
|
||||||
|
ON DELETE NO ACTION
|
||||||
|
ON UPDATE NO ACTION)
|
||||||
|
ENGINE = InnoDB
|
||||||
|
COMMENT = 'This table contains the data related to the application subscriptions';
|
||||||
|
|
||||||
|
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
-- Table `APPM_COMMENT`
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
CREATE TABLE IF NOT EXISTS `APPM_COMMENT` (
|
||||||
|
`ID` INT NOT NULL AUTO_INCREMENT,
|
||||||
|
`APPM_APPLICATION_RELEASE_ID` INT NOT NULL,
|
||||||
|
`COMMENT` TEXT NULL,
|
||||||
|
`RATING` INT NULL,
|
||||||
|
`PARENT_ID` INT NULL,
|
||||||
|
`CREATED_AT` DATETIME NULL,
|
||||||
|
`CREATED_BY` VARCHAR(45) NULL,
|
||||||
|
`MODIFIED_AT` DATETIME NULL,
|
||||||
|
`PUBLISHED` TINYINT NULL,
|
||||||
|
PRIMARY KEY (`ID`, `APPM_APPLICATION_RELEASE_ID`),
|
||||||
|
INDEX `FK_APPLICATION_COMMENTS_APPLICATION_RELEASE` (`APPM_APPLICATION_RELEASE_ID` ASC),
|
||||||
|
CONSTRAINT `FK_APPLICATION_COMMENTS_APPLICATION_RELEASE`
|
||||||
|
FOREIGN KEY (`APPM_APPLICATION_RELEASE_ID`)
|
||||||
|
REFERENCES `APPM_APPLICATION_RELEASE` (`ID`)
|
||||||
|
ON DELETE NO ACTION
|
||||||
|
ON UPDATE NO ACTION)
|
||||||
|
ENGINE = InnoDB
|
||||||
|
COMMENT = 'This table contains the data related to the application comments';
|
||||||
|
|
||||||
|
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
-- Table `APPM_PLATFORM_APPLICATION_MAPPING`
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
CREATE TABLE IF NOT EXISTS `APPM_PLATFORM_APPLICATION_MAPPING` (
|
||||||
|
`ID` INT NOT NULL AUTO_INCREMENT,
|
||||||
|
`APPM_PLATFORM_ID` INT NOT NULL,
|
||||||
|
`TENANT_ID` INT NULL,
|
||||||
|
`APPM_APPLICATION_ID` INT NOT NULL,
|
||||||
|
PRIMARY KEY (`ID`, `APPM_PLATFORM_ID`, `APPM_APPLICATION_ID`),
|
||||||
|
INDEX `FK_PLATFROM_APPLICATION_MAPPING_PLATFORM` (`APPM_PLATFORM_ID` ASC),
|
||||||
|
INDEX `FK_PLATFROM_APPLICATION_MAPPING_APPLICATION` (`APPM_APPLICATION_ID` ASC),
|
||||||
|
CONSTRAINT `fk_APPM_PLATFORM_TENANT_MAPPING_APPM_SUPPORTED_PLATFORM1`
|
||||||
|
FOREIGN KEY (`APPM_PLATFORM_ID`)
|
||||||
|
REFERENCES `APPM_APPLICATION_PLATFORM` (`ID`)
|
||||||
|
ON DELETE NO ACTION
|
||||||
|
ON UPDATE NO ACTION,
|
||||||
|
CONSTRAINT `fk_APPM_PLATFORM_TENANT_MAPPING_APPM_APPLICATION1`
|
||||||
|
FOREIGN KEY (`APPM_APPLICATION_ID`)
|
||||||
|
REFERENCES `APPM_APPLICATION` (`ID`)
|
||||||
|
ON DELETE NO ACTION
|
||||||
|
ON UPDATE NO ACTION)
|
||||||
|
ENGINE = InnoDB
|
||||||
|
COMMENT = 'This table contains the data related relationship between application platofrm and appication mappings';
|
||||||
|
|
||||||
|
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
-- Table `APPM_PLATFORM_TAG`
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
CREATE TABLE IF NOT EXISTS `APPM_PLATFORM_TAG` (
|
||||||
|
`name` VARCHAR(100) NOT NULL,
|
||||||
|
`APPM_PLATFORM_ID` INT NOT NULL,
|
||||||
|
PRIMARY KEY (`APPM_PLATFORM_ID`, `name`),
|
||||||
|
INDEX `fk_PLATFORM_TAGS_PLATFORM` (`APPM_PLATFORM_ID` ASC),
|
||||||
|
CONSTRAINT `fk_APPM_SUPPORTED_PLATFORM_TAGS_APPM_SUPPORTED_PLATFORM1`
|
||||||
|
FOREIGN KEY (`APPM_PLATFORM_ID`)
|
||||||
|
REFERENCES `APPM_APPLICATION_PLATFORM` (`ID`)
|
||||||
|
ON DELETE NO ACTION
|
||||||
|
ON UPDATE NO ACTION)
|
||||||
|
ENGINE = InnoDB
|
||||||
|
COMMENT = 'This table contains the data related to the app platform tags';
|
||||||
|
|
||||||
|
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
-- Table `APPM_APPLICATION_TAG`
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
CREATE TABLE IF NOT EXISTS `APPM_APPLICATION_TAG` (
|
||||||
|
`name` VARCHAR(45) NOT NULL,
|
||||||
|
`APPM_APPLICATION_ID` INT NOT NULL,
|
||||||
|
PRIMARY KEY (`APPM_APPLICATION_ID`, `name`),
|
||||||
|
INDEX `FK_APPLICATION_TAG_APPLICATION` (`APPM_APPLICATION_ID` ASC),
|
||||||
|
CONSTRAINT `fk_APPM_APPLICATION_TAG_APPM_APPLICATION1`
|
||||||
|
FOREIGN KEY (`APPM_APPLICATION_ID`)
|
||||||
|
REFERENCES `APPM_APPLICATION` (`ID`)
|
||||||
|
ON DELETE NO ACTION
|
||||||
|
ON UPDATE NO ACTION)
|
||||||
|
ENGINE = InnoDB
|
||||||
|
COMMENT = 'This table contains the data related to the application tags';
|
@ -1,3 +1,7 @@
|
|||||||
instructions.configure = \
|
instructions.configure = \
|
||||||
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.application.mgt.server_${feature.version}/conf/datasources/application-mgt-datasources.xml,target:${installFolder}/../../conf/datasources/application-mgt-datasources.xml,overwrite:true);\
|
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.application.mgt.server_${feature.version}/conf/datasources/application-mgt-datasources.xml,target:${installFolder}/../../conf/datasources/application-mgt-datasources.xml,overwrite:true);\
|
||||||
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.application.mgt.server_${feature.version}/dbscripts/cdm/application-mgt,target:${installFolder}/../../../dbscripts/cdm/application-mgt,overwrite:true);\
|
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.application.mgt.server_${feature.version}/dbscripts/cdm/application-mgt,target:${installFolder}/../../../dbscripts/cdm/application-mgt,overwrite:true);\
|
||||||
|
|
||||||
|
instructions.unconfigure = \
|
||||||
|
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../conf/datasources/application-mgt-datasources.xml);\
|
||||||
|
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../dbscripts/cdm/application-mgt);\
|
||||||
|
Loading…
Reference in new issue