Fix server startup issue.

Due to syntax erros in h2 scripts, Application Management OSGI service didin't started properly. Hence fixed those issues and added improvements to DB as well.
feature/appm-store/pbac
lasanthaDLPDS 6 years ago
parent 968ec07c9b
commit 4c9f0936b6

@ -2,7 +2,7 @@
-- Table AP_APP
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AP_APP(
ID INT(11) NOT NULL AUTO_INCREMENT,
ID INTEGER NOT NULL AUTO_INCREMENT,
NAME VARCHAR(45) NOT NULL,
DESCRIPTION CLOB NULL,
TYPE VARCHAR(200) NOT NULL,
@ -10,23 +10,23 @@ CREATE TABLE IF NOT EXISTS AP_APP(
STATUS VARCHAR(45) NOT NULL DEFAULT 'ACTIVE',
SUB_TYPE VARCHAR(45) NOT NULL,
CURRENCY VARCHAR(45) NULL DEFAULT '$',
RATING INT(11) NULL,
DEVICE_TYPE_ID INT NOT NULL,
PRIMARY KEY (ID)
RATING INTEGER NULL,
DEVICE_TYPE_ID INTEGER NOT NULL,
PRIMARY KEY (ID)
);
-- -----------------------------------------------------
-- Table AP_APP_RELEASE
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AP_APP_RELEASE(
ID INT(11) NOT NULL AUTO_INCREMENT,
ID INTEGER NOT NULL AUTO_INCREMENT,
DESCRIPTION CLOB NOT NULL,
VERSION VARCHAR(10) NOT NULL,
TENANT_ID VARCHAR(45) NOT NULL,
UUID VARCHAR(200) NOT NULL,
RELEASE_TYPE VARCHAR(45) NOT NULL,
PACKAGE_NAME VARCHAR(45) NOT NULL,
APP_PRICE decimal(6, 2) NULL DEFAULT NULL,
APP_PRICE DECIMAL(6, 2) NULL DEFAULT NULL,
INSTALLER_LOCATION VARCHAR(100) NOT NULL,
ICON_LOCATION VARCHAR(100) NOT NULL,
BANNER_LOCATION VARCHAR(100) NOT NULL,
@ -34,75 +34,66 @@ CREATE TABLE IF NOT EXISTS AP_APP_RELEASE(
SC_2_LOCATION VARCHAR(100) NULL DEFAULT NULL,
SC_3_LOCATION VARCHAR(100) NULL DEFAULT NULL,
APP_HASH_VALUE VARCHAR(1000) NOT NULL,
SHARED_WITH_ALL_TENANTS tinyINT NOT NULL,
SHARED_WITH_ALL_TENANTS BOOLEAN NOT NULL DEFAULT FALSE,
APP_META_INFO CLOB NULL DEFAULT NULL,
SUPPORTED_OS_VERSIONS VARCHAR(45) NOT NULL,
RATING DOUBLE NULL DEFAULT NULL,
CURRENT_STATE VARCHAR(45) NOT NULL,
RATED_USERS INT(11) NULL,
AP_APP_ID INT(11) NOT NULL,
PRIMARY KEY (ID),
RATED_USERS INTEGER NULL,
AP_APP_ID INTEGER NOT NULL,
PRIMARY KEY (ID, AP_APP_ID),
CONSTRAINT fk_AP_APP_RELEASE_AP_APP1
FOREIGN KEY (AP_APP_ID)
REFERENCES AP_APP (ID));
REFERENCES AP_APP (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
CREATE INDEX fk_AP_APP_RELEASE_AP_APP1_idx ON AP_APP_RELEASE (AP_APP_ID ASC);
-- -----------------------------------------------------
-- Table AP_APP_REVIEW
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AP_APP_REVIEW(
ID INT(11) NOT NULL AUTO_INCREMENT,
ID INTEGER NOT NULL AUTO_INCREMENT,
TENANT_ID VARCHAR(45) NOT NULL,
COMMENT VARCHAR(250) NOT NULL,
REPLY_COMMENT VARCHAR(250) NULL,
CREATED_AT TIMESTAMP NOT NULL,
MODIFIED_AT TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
RATING INT(11) NULL,
MODIFIED_AT TIMESTAMP NOT NULL,
RATING INTEGER NULL,
USERNAME VARCHAR(45) NOT NULL,
AP_APP_RELEASE_ID INT NOT NULL,
AP_APP_ID INT(11) NOT NULL,
AP_APP_RELEASE_ID INTEGER NOT NULL,
AP_APP_ID INTEGER NOT NULL,
PRIMARY KEY (ID),
CONSTRAINT fk_AP_APP_COMMENT_AP_APP_RELEASE1
FOREIGN KEY (
AP_APP_RELEASE_ID,
AP_APP_ID
)
REFERENCES AP_APP_RELEASE (
ID,
AP_APP_ID
) );
FOREIGN KEY (AP_APP_RELEASE_ID, AP_APP_ID)
REFERENCES AP_APP_RELEASE (ID, AP_APP_ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
CREATE INDEX fk_AP_APP_COMMENT_AP_APP_RELEASE1_idx ON AP_APP_REVIEW (AP_APP_RELEASE_ID ASC, AP_APP_ID ASC);
-- -----------------------------------------------------
-- Table AP_APP_LIFECYCLE_STATE
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AP_APP_LIFECYCLE_STATE(
ID INT(11) NOT NULL AUTO_INCREMENT,
ID INTEGER NOT NULL AUTO_INCREMENT,
CURRENT_STATE VARCHAR(45) NOT NULL,
PREVIOUS_STATE VARCHAR(45) NOT NULL,
PREVIOUSE_STATE VARCHAR(45) NOT NULL,
TENANT_ID VARCHAR(45) NOT NULL,
UPDATED_BY VARCHAR(100) NOT NULL,
UPDATED_AT timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
AP_APP_RELEASE_ID INT NOT NULL,
AP_APP_ID INT(11) NOT NULL,
PRIMARY KEY (
ID,
AP_APP_RELEASE_ID,
AP_APP_ID
),
UPDATED_AT TIMESTAMP NOT NULL,
AP_APP_RELEASE_ID INTEGER NOT NULL,
AP_APP_ID INTEGER NOT NULL,
REASON VARCHAR(45) NULL,
PRIMARY KEY (ID, AP_APP_RELEASE_ID, AP_APP_ID),
CONSTRAINT fk_AP_APP_LIFECYCLE_STATE_AP_APP_RELEASE1
FOREIGN KEY (
AP_APP_RELEASE_ID,
AP_APP_ID
)
REFERENCES AP_APP_RELEASE (
ID,
AP_APP_ID
) );
FOREIGN KEY (AP_APP_RELEASE_ID, AP_APP_ID)
REFERENCES AP_APP_RELEASE (ID, AP_APP_ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
CREATE INDEX fk_AP_APP_LIFECYCLE_STATE_AP_APP_RELEASE1_idx ON AP_APP_LIFECYCLE_STATE( AP_APP_RELEASE_ID ASC, AP_APP_ID ASC);
-- -----------------------------------------------------
-- Table AP_APP_TAG
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AP_APP_TAG(
ID INT(11) NOT NULL AUTO_INCREMENT,
ID INTEGER NOT NULL AUTO_INCREMENT,
TENANT_ID VARCHAR(45) NOT NULL,
TAG VARCHAR(45) NOT NULL,
PRIMARY KEY (ID)
@ -112,121 +103,107 @@ CREATE TABLE IF NOT EXISTS AP_APP_TAG(
-- Table AP_DEVICE_SUBSCRIPTION
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AP_DEVICE_SUBSCRIPTION(
ID INT(11) NOT NULL AUTO_INCREMENT,
ID INTEGER NOT NULL AUTO_INCREMENT,
TENANT_ID VARCHAR(45) NOT NULL,
SUBSCRIBED_BY VARCHAR(100) NOT NULL,
SUBSCRIBED_TIMESTAMP timestamp NOT NULL,
UNSUBSCRIBED INT(11) NULL DEFAULT NULL,
UNSUBSCRIBED_BY INT(11) NULL DEFAULT NULL,
UNSUBSCRIBED_TIMESTAMP timestamp NULL DEFAULT NULL,
SUBSCRIBED_TIMESTAMP TIMESTAMP NOT NULL,
UNSUBSCRIBED INTEGER NULL DEFAULT NULL,
UNSUBSCRIBED_BY INTEGER NULL DEFAULT NULL,
UNSUBSCRIBED_TIMESTAMP TIMESTAMP NULL DEFAULT NULL,
SUBSCRIBED_FROM VARCHAR(45) NULL,
DM_DEVICE_ID INT(11) NOT NULL,
AP_APP_RELEASE_ID INT(11) NOT NULL,
AP_APP_ID INT(11) NOT NULL,
DM_DEVICE_ID INTEGER NOT NULL,
AP_APP_RELEASE_ID INTEGER NOT NULL,
AP_APP_ID INTEGER NOT NULL,
PRIMARY KEY (ID),
CONSTRAINT fk_AP_DEVICE_SUBSCRIPTION_AP_APP_RELEASE1
FOREIGN KEY (
AP_APP_RELEASE_ID,
AP_APP_ID
)
REFERENCES AP_APP_RELEASE (
ID,
AP_APP_ID
) );
FOREIGN KEY (AP_APP_RELEASE_ID, AP_APP_ID)
REFERENCES AP_APP_RELEASE (ID, AP_APP_ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
CREATE INDEX fk_AP_DEVICE_SUBSCRIPTION_AP_APP_RELEASE1_idx ON AP_DEVICE_SUBSCRIPTION (AP_APP_RELEASE_ID ASC, AP_APP_ID ASC);
-- -----------------------------------------------------
-- Table AP_GROUP_SUBSCRIPTION
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AP_GROUP_SUBSCRIPTION(
ID INT(11) NOT NULL AUTO_INCREMENT,
ID INTEGER NOT NULL AUTO_INCREMENT,
TENANT_ID VARCHAR(45) NOT NULL,
SUBSCRIBED_BY VARCHAR(100) NOT NULL,
SUBSCRIBED_TIMESTAMP timestamp NOT NULL,
UNSUBSCRIBED INT(11) NULL DEFAULT NULL,
UNSUBSCRIBED_BY INT(11) NULL DEFAULT NULL,
UNSUBSCRIBED_TIMESTAMP timestamp NULL DEFAULT NULL,
DM_GROUP_ID INT(11) NOT NULL,
AP_APP_RELEASE_ID INT(11) NOT NULL,
AP_APP_ID INT(11) NOT NULL,
SUBSCRIBED_TIMESTAMP TIMESTAMP NOT NULL,
UNSUBSCRIBED INTEGER NULL DEFAULT NULL,
UNSUBSCRIBED_BY INTEGER NULL DEFAULT NULL,
UNSUBSCRIBED_TIMESTAMP TIMESTAMP NULL DEFAULT NULL,
DM_GROUP_ID INTEGER NOT NULL,
AP_APP_RELEASE_ID INTEGER NOT NULL,
AP_APP_ID INTEGER NOT NULL,
PRIMARY KEY (ID),
CONSTRAINT fk_AP_GROUP_SUBSCRIPTION_AP_APP_RELEASE1
FOREIGN KEY (
AP_APP_RELEASE_ID,
AP_APP_ID
)
REFERENCES AP_APP_RELEASE (
ID,
AP_APP_ID
) );
FOREIGN KEY (AP_APP_RELEASE_ID, AP_APP_ID)
REFERENCES AP_APP_RELEASE (ID, AP_APP_ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
CREATE INDEX fk_AP_GROUP_SUBSCRIPTION_AP_APP_RELEASE1_idx ON AP_GROUP_SUBSCRIPTION (AP_APP_RELEASE_ID ASC,AP_APP_ID ASC);
-- -----------------------------------------------------
-- Table AP_ROLE_SUBSCRIPTION
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AP_ROLE_SUBSCRIPTION(
ID INT(11) NOT NULL AUTO_INCREMENT,
ID INTEGER NOT NULL AUTO_INCREMENT,
TENANT_ID VARCHAR(45) NOT NULL,
ROLE_NAME VARCHAR(100) NOT NULL,
SUBSCRIBED_BY VARCHAR(100) NOT NULL,
SUBSCRIBED_TIMESTAMP timestamp NOT NULL,
UNSUBSCRIBED INT(11) NULL DEFAULT NULL,
UNSUBSCRIBED_BY INT(11) NULL DEFAULT NULL,
UNSUBSCRIBED_TIMESTAMP timestamp NULL DEFAULT NULL,
AP_APP_RELEASE_ID INT(11) NOT NULL,
AP_APP_ID INT(11) NOT NULL,
SUBSCRIBED_TIMESTAMP TIMESTAMP NOT NULL,
UNSUBSCRIBED INTEGER NULL DEFAULT NULL,
UNSUBSCRIBED_BY INTEGER NULL DEFAULT NULL,
UNSUBSCRIBED_TIMESTAMP TIMESTAMP NULL DEFAULT NULL,
AP_APP_RELEASE_ID INTEGER NOT NULL,
AP_APP_ID INTEGER NOT NULL,
PRIMARY KEY (ID),
CONSTRAINT fk_AP_ROLE_SUBSCRIPTION_AP_APP_RELEASE1
FOREIGN KEY (
AP_APP_RELEASE_ID,
AP_APP_ID
)
REFERENCES AP_APP_RELEASE (
ID,
AP_APP_ID
) );
FOREIGN KEY (AP_APP_RELEASE_ID, AP_APP_ID)
REFERENCES AP_APP_RELEASE (ID, AP_APP_ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
CREATE INDEX fk_AP_ROLE_SUBSCRIPTION_AP_APP_RELEASE1_idx ON AP_ROLE_SUBSCRIPTION (AP_APP_RELEASE_ID ASC, AP_APP_ID ASC);
-- -----------------------------------------------------
-- Table AP_UNRESTRICTED_ROLE
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AP_UNRESTRICTED_ROLE(
ID INT(11) NOT NULL AUTO_INCREMENT,
ID INTEGER NOT NULL AUTO_INCREMENT,
TENANT_ID VARCHAR(45) NOT NULL,
ROLE VARCHAR(45) NOT NULL,
AP_APP_ID INT(11) NOT NULL,
AP_APP_ID INTEGER NOT NULL,
PRIMARY KEY (ID),
CONSTRAINT fk_AP_APP_VISIBILITY_AP_APP1
FOREIGN KEY (AP_APP_ID)
REFERENCES AP_APP (ID) );
REFERENCES AP_APP (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
CREATE INDEX fk_AP_APP_VISIBILITY_AP_APP1_idx ON AP_UNRESTRICTED_ROLE (AP_APP_ID ASC);
-- -----------------------------------------------------
-- Table AP_USER_SUBSCRIPTION
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AP_USER_SUBSCRIPTION(
ID INT(11) NOT NULL AUTO_INCREMENT,
ID INTEGER NOT NULL AUTO_INCREMENT,
TENANT_ID VARCHAR(45) NOT NULL,
USER_NAME VARCHAR(100) NOT NULL,
SUBSCRIBED_BY VARCHAR(100) NOT NULL,
SUBSCRIBED_TIMESTAMP timestamp NOT NULL,
UNSUBSCRIBED INT(11) NULL DEFAULT NULL,
UNSUBSCRIBED_BY INT(11) NULL DEFAULT NULL,
UNSUBSCRIBED_TIMESTAMP timestamp NULL DEFAULT NULL,
AP_APP_RELEASE_ID INT(11) NOT NULL,
AP_APP_ID INT(11) NOT NULL,
SUBSCRIBED_TIMESTAMP TIMESTAMP NOT NULL,
UNSUBSCRIBED INTEGER NULL DEFAULT NULL,
UNSUBSCRIBED_BY INTEGER NULL DEFAULT NULL,
UNSUBSCRIBED_TIMESTAMP TIMESTAMP NULL DEFAULT NULL,
AP_APP_RELEASE_ID INTEGER NOT NULL,
AP_APP_ID INTEGER NOT NULL,
PRIMARY KEY (ID),
CONSTRAINT fk_AP_USER_SUBSCRIPTION_AP_APP_RELEASE1
FOREIGN KEY (
AP_APP_RELEASE_ID,
AP_APP_ID
)
REFERENCES AP_APP_RELEASE (
ID,
AP_APP_ID
) );
FOREIGN KEY (AP_APP_RELEASE_ID, AP_APP_ID)
REFERENCES AP_APP_RELEASE (ID, AP_APP_ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
CREATE INDEX fk_AP_USER_SUBSCRIPTION_AP_APP_RELEASE1_idx ON AP_USER_SUBSCRIPTION (AP_APP_RELEASE_ID ASC, AP_APP_ID ASC);
-- -----------------------------------------------------
-- Table AP_APP_CATEGORY
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AP_APP_CATEGORY(
ID INT(11) NOT NULL AUTO_INCREMENT,
ID INTEGER NOT NULL AUTO_INCREMENT,
TENANT_ID VARCHAR(45) NOT NULL,
CATEGORY VARCHAR(45) NOT NULL,
CATEGORY_ICON VARCHAR(45) NULL,
@ -237,28 +214,34 @@ CREATE TABLE IF NOT EXISTS AP_APP_CATEGORY(
-- Table AP_APP_TAG_MAPPING
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AP_APP_TAG_MAPPING(
ID INT(11) NOT NULL AUTO_INCREMENT,
AP_APP_TAG_ID INT(11) NOT NULL,
AP_APP_ID INT(11) NOT NULL,
ID INTEGER NOT NULL AUTO_INCREMENT,
AP_APP_TAG_ID INTEGER NOT NULL,
AP_APP_ID INTEGER NOT NULL,
PRIMARY KEY (ID),
CONSTRAINT fk_AP_APP_TAG_copy1_AP_APP_TAG1
FOREIGN KEY (AP_APP_TAG_ID)
REFERENCES AP_APP_TAG (ID),
REFERENCES AP_APP_TAG (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT fk_AP_APP_TAG_copy1_AP_APP1
FOREIGN KEY (AP_APP_ID)
REFERENCES AP_APP (ID) );
REFERENCES AP_APP (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
CREATE INDEX fk_AP_APP_TAG_copy1_AP_APP_TAG1_idx ON AP_APP_TAG_MAPPING (AP_APP_TAG_ID ASC);
CREATE INDEX fk_AP_APP_TAG_copy1_AP_APP1_idx ON AP_APP_TAG_MAPPING (AP_APP_ID ASC);
-- -----------------------------------------------------
-- Table AP_APP_CATEGORY_MAPPING
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AP_APP_CATEGORY_MAPPING(
ID INT(11) NOT NULL AUTO_INCREMENT,
AP_APP_CATEGORY_ID INT(11) NOT NULL,
AP_APP_ID INT(11) NOT NULL,
ID INTEGER NOT NULL AUTO_INCREMENT,
AP_APP_CATEGORY_ID INTEGER NOT NULL,
AP_APP_ID INTEGER NOT NULL,
PRIMARY KEY (ID),
CONSTRAINT fk_AP_APP_CATEGORY_copy1_AP_APP_CATEGORY1
FOREIGN KEY (AP_APP_CATEGORY_ID)
REFERENCES AP_APP_CATEGORY (ID),
REFERENCES AP_APP_CATEGORY (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT fk_AP_APP_CATEGORY_copy1_AP_APP1
FOREIGN KEY (AP_APP_ID)
REFERENCES AP_APP (ID) );
REFERENCES AP_APP (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
CREATE INDEX fk_AP_APP_CATEGORY_copy1_AP_APP_CATEGORY1_idx ON AP_APP_CATEGORY_MAPPING (AP_APP_CATEGORY_ID ASC);
CREATE INDEX fk_AP_APP_CATEGORY_copy1_AP_APP1_idx ON AP_APP_CATEGORY_MAPPING (AP_APP_ID ASC);

@ -5,9 +5,34 @@ SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Table `AP_APP`
-- Schema APP_MANAGER
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `AP_APP` (
-- -----------------------------------------------------
-- Schema APP_MANAGER
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `APP_MANAGER` DEFAULT CHARACTER SET utf8 ;
USE `APP_MANAGER` ;
-- -----------------------------------------------------
-- Table `APP_MANAGER`.`DM_DEVICE_TYPE`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`DM_DEVICE_TYPE` (
`ID` INT(11) NOT NULL AUTO_INCREMENT,
`NAME` VARCHAR(300) NULL DEFAULT NULL,
`DEVICE_TYPE_META` VARCHAR(20000) NULL DEFAULT NULL,
`LAST_UPDATED_TIMESTAMP` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`PROVIDER_TENANT_ID` INT(11) NULL DEFAULT '0',
`SHARED_WITH_ALL_TENANTS` TINYINT(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `APP_MANAGER`.`AP_APP`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_APP` (
`ID` INT(11) NOT NULL AUTO_INCREMENT,
`NAME` VARCHAR(45) NOT NULL,
`DESCRIPTION` TEXT NULL,
@ -18,53 +43,58 @@ CREATE TABLE IF NOT EXISTS `AP_APP` (
`CURRENCY` VARCHAR(45) NULL DEFAULT '$',
`RATING` INT(11) NULL,
`DEVICE_TYPE_ID` INT(11) NOT NULL,
PRIMARY KEY (`ID`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
PRIMARY KEY (`ID`),
INDEX `fk_AP_APP_DM_DEVICE_TYPE1_idx` (`DEVICE_TYPE_ID` ASC),
CONSTRAINT `fk_AP_APP_DM_DEVICE_TYPE1`
FOREIGN KEY (`DEVICE_TYPE_ID`)
REFERENCES `APP_MANAGER`.`DM_DEVICE_TYPE` (`ID`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `AP_APP_RELEASE`
-- Table `APP_MANAGER`.`AP_APP_RELEASE`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `AP_APP_RELEASE` (
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_APP_RELEASE` (
`ID` INT(11) NOT NULL AUTO_INCREMENT,
`DESCRIPTION` TEXT NOT NULL,
`VERSION` VARCHAR(10) NOT NULL,
`TENANT_ID` VARCHAR(45) NOT NULL,
`UUID` VARCHAR(200) NOT NULL,
`RELEASE_TYPE` VARCHAR(45) NOT NULL,
`PACKAGE_NAME` VARCHAR(45) NOT NULL,
`APP_PRICE` DECIMAL(6,2) NULL DEFAULT NULL,
`INSTALLER_LOCATION` VARCHAR(100) NOT NULL,
`ICON_LOCATION` VARCHAR(100) NOT NULL,
`BANNER_LOCATION` VARCHAR(100) NOT NULL,
`SC_1_LOCATION` VARCHAR(100) NOT NULL,
`SC_2_LOCATION` VARCHAR(100) NULL DEFAULT NULL,
`SC_3_LOCATION` VARCHAR(100) NULL DEFAULT NULL,
`STORED_LOCATION` VARCHAR(45) NOT NULL,
`BANNER_LOCATION` VARCHAR(45) NOT NULL,
`SC_1_LOCATION` VARCHAR(45) NOT NULL,
`SC_2_LOCATION` VARCHAR(45) NULL DEFAULT NULL,
`SC_3_LOCATION` VARCHAR(45) NULL DEFAULT NULL,
`APP_HASH_VALUE` VARCHAR(1000) NOT NULL,
`SHARED_WITH_ALL_TENANTS` TINYINT(1) NOT NULL,
`SHARED_WITH_ALL_TENANTS` TINYINT(1) NULL DEFAULT NULL,
`APP_META_INFO` TEXT NULL DEFAULT NULL,
`SUPPORTED_OS_VERSIONS` VARCHAR(45) NOT NULL,
`PACKAGE_NAME` VARCHAR(45) NOT NULL,
`SUPPORTED_OS_VERSIONS` VARCHAR(45) NULL,
`RATING` DOUBLE NULL DEFAULT NULL,
`CURRENT_STATE` VARCHAR(45) NOT NULL,
`CURRENT_STATE` VARCHAR(45) NULL,
`RATED_USERS` INT(11) NULL,
`AP_APP_ID` INT(11) NOT NULL,
PRIMARY KEY (`ID`),
PRIMARY KEY (`ID`, `AP_APP_ID`),
INDEX `fk_AP_APP_RELEASE_AP_APP1_idx` (`AP_APP_ID` ASC),
CONSTRAINT `fk_AP_APP_RELEASE_AP_APP1`
FOREIGN KEY (`AP_APP_ID`)
REFERENCES `AP_APP` (`ID`)
REFERENCES `APP_MANAGER`.`AP_APP` (`ID`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COMMENT = ' ';
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COMMENT = ' ';
-- -----------------------------------------------------
-- Table `AP_APP_REVIEW`
-- Table `APP_MANAGER`.`AP_APP_REVIEW`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `AP_APP_REVIEW` (
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_APP_REVIEW` (
`ID` INT(11) NOT NULL AUTO_INCREMENT,
`TENANT_ID` VARCHAR(45) NOT NULL,
`COMMENT` VARCHAR(250) NOT NULL,
@ -79,52 +109,76 @@ CREATE TABLE IF NOT EXISTS `AP_APP_REVIEW` (
INDEX `fk_AP_APP_COMMENT_AP_APP_RELEASE1_idx` (`AP_APP_RELEASE_ID` ASC, `AP_APP_ID` ASC),
CONSTRAINT `fk_AP_APP_COMMENT_AP_APP_RELEASE1`
FOREIGN KEY (`AP_APP_RELEASE_ID` , `AP_APP_ID`)
REFERENCES `AP_APP_RELEASE` (`ID` , `AP_APP_ID`)
REFERENCES `APP_MANAGER`.`AP_APP_RELEASE` (`ID` , `AP_APP_ID`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `AP_APP_LIFECYCLE_STATE`
-- Table `APP_MANAGER`.`AP_APP_LIFECYCLE_STATE`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `AP_APP_LIFECYCLE_STATE` (
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_APP_LIFECYCLE_STATE` (
`ID` INT(11) NOT NULL AUTO_INCREMENT,
`CURRENT_STATE` VARCHAR(45) NOT NULL,
`PREVIOUSE_STATE` VARCHAR(45) NOT NULL,
`TENANT_ID` VARCHAR(45) NOT NULL,
`UPDATED_BY` VARCHAR(100) NOT NULL,
`UPDATED_AT` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`REASON` VARCHAR(45) NULL,
`AP_APP_RELEASE_ID` INT(11) NOT NULL,
`AP_APP_ID` INT(11) NOT NULL,
PRIMARY KEY (`ID`, `AP_APP_RELEASE_ID`, `AP_APP_ID`),
INDEX `fk_AP_APP_LIFECYCLE_STATE_AP_APP_RELEASE1_idx` (`AP_APP_RELEASE_ID` ASC, `AP_APP_ID` ASC),
CONSTRAINT `fk_AP_APP_LIFECYCLE_STATE_AP_APP_RELEASE1`
FOREIGN KEY (`AP_APP_RELEASE_ID` , `AP_APP_ID`)
REFERENCES `AP_APP_RELEASE` (`ID` , `AP_APP_ID`)
REFERENCES `APP_MANAGER`.`AP_APP_RELEASE` (`ID` , `AP_APP_ID`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `AP_APP_TAG`
-- Table `APP_MANAGER`.`AP_APP_TAG`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `AP_APP_TAG` (
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_APP_TAG` (
`ID` INT(11) NOT NULL AUTO_INCREMENT,
`TENANT_ID` VARCHAR(45) NOT NULL,
`TAG` VARCHAR(45) NOT NULL,
`TENANT_ID` VARCHAR(45) NOT NULL,
PRIMARY KEY (`ID`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `AP_DEVICE_SUBSCRIPTION`
-- Table `APP_MANAGER`.`DM_DEVICE`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `AP_DEVICE_SUBSCRIPTION` (
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`DM_DEVICE` (
`ID` INT(11) NOT NULL AUTO_INCREMENT,
`DESCRIPTION` TEXT NULL DEFAULT NULL,
`NAME` VARCHAR(100) NULL DEFAULT NULL,
`DEVICE_TYPE_ID` INT(11) NULL DEFAULT NULL,
`DEVICE_IDENTIFICATION` VARCHAR(250) NULL DEFAULT NULL,
`LAST_UPDATED_TIMESTAMP` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`TENANT_ID` INT(11) NULL DEFAULT '0',
PRIMARY KEY (`ID`),
UNIQUE INDEX `uk_DM_DEVICE` (`DEVICE_TYPE_ID` ASC, `DEVICE_IDENTIFICATION` ASC, `TENANT_ID` ASC),
INDEX `fk_DM_DEVICE_DM_DEVICE_TYPE2` (`DEVICE_TYPE_ID` ASC),
CONSTRAINT `fk_DM_DEVICE_DM_DEVICE_TYPE2`
FOREIGN KEY (`DEVICE_TYPE_ID`)
REFERENCES `APP_MANAGER`.`DM_DEVICE_TYPE` (`ID`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `APP_MANAGER`.`AP_DEVICE_SUBSCRIPTION`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_DEVICE_SUBSCRIPTION` (
`ID` INT(11) NOT NULL AUTO_INCREMENT,
`TENANT_ID` VARCHAR(45) NOT NULL,
`SUBSCRIBED_BY` VARCHAR(100) NOT NULL,
@ -139,18 +193,38 @@ CREATE TABLE IF NOT EXISTS `AP_DEVICE_SUBSCRIPTION` (
PRIMARY KEY (`ID`),
INDEX `fk_AM_DEVICE_SUBSCRIPTION_DM_DEVICE1_idx` (`DM_DEVICE_ID` ASC),
INDEX `fk_AP_DEVICE_SUBSCRIPTION_AP_APP_RELEASE1_idx` (`AP_APP_RELEASE_ID` ASC, `AP_APP_ID` ASC),
CONSTRAINT `fk_AM_DEVICE_SUBSCRIPTION_DM_DEVICE1`
FOREIGN KEY (`DM_DEVICE_ID`)
REFERENCES `APP_MANAGER`.`DM_DEVICE` (`ID`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_AP_DEVICE_SUBSCRIPTION_AP_APP_RELEASE1`
FOREIGN KEY (`AP_APP_RELEASE_ID` , `AP_APP_ID`)
REFERENCES `AP_APP_RELEASE` (`ID` , `AP_APP_ID`)
REFERENCES `APP_MANAGER`.`AP_APP_RELEASE` (`ID` , `AP_APP_ID`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `AP_GROUP_SUBSCRIPTION`
-- Table `APP_MANAGER`.`DM_GROUP`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `AP_GROUP_SUBSCRIPTION` (
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`DM_GROUP` (
`ID` INT(11) NOT NULL AUTO_INCREMENT,
`GROUP_NAME` VARCHAR(100) NULL DEFAULT NULL,
`DESCRIPTION` TEXT NULL DEFAULT NULL,
`OWNER` VARCHAR(45) NULL DEFAULT NULL,
`TENANT_ID` INT(11) NULL DEFAULT '0',
PRIMARY KEY (`ID`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `APP_MANAGER`.`AP_GROUP_SUBSCRIPTION`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_GROUP_SUBSCRIPTION` (
`ID` INT(11) NOT NULL AUTO_INCREMENT,
`TENANT_ID` VARCHAR(45) NOT NULL,
`SUBSCRIBED_BY` VARCHAR(100) NOT NULL,
@ -164,19 +238,24 @@ CREATE TABLE IF NOT EXISTS `AP_GROUP_SUBSCRIPTION` (
PRIMARY KEY (`ID`),
INDEX `fk_AM_GROUP_SUBSCRIPTION_DM_GROUP1_idx` (`DM_GROUP_ID` ASC),
INDEX `fk_AP_GROUP_SUBSCRIPTION_AP_APP_RELEASE1_idx` (`AP_APP_RELEASE_ID` ASC, `AP_APP_ID` ASC),
CONSTRAINT `fk_AM_GROUP_SUBSCRIPTION_DM_GROUP1`
FOREIGN KEY (`DM_GROUP_ID`)
REFERENCES `APP_MANAGER`.`DM_GROUP` (`ID`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_AP_GROUP_SUBSCRIPTION_AP_APP_RELEASE1`
FOREIGN KEY (`AP_APP_RELEASE_ID` , `AP_APP_ID`)
REFERENCES `AP_APP_RELEASE` (`ID` , `AP_APP_ID`)
REFERENCES `APP_MANAGER`.`AP_APP_RELEASE` (`ID` , `AP_APP_ID`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `APP_MANAGER`.`AP_ROLE_SUBSCRIPTION`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `AP_ROLE_SUBSCRIPTION` (
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_ROLE_SUBSCRIPTION` (
`ID` INT(11) NOT NULL AUTO_INCREMENT,
`TENANT_ID` VARCHAR(45) NOT NULL,
`ROLE_NAME` VARCHAR(100) NOT NULL,
@ -191,17 +270,17 @@ CREATE TABLE IF NOT EXISTS `AP_ROLE_SUBSCRIPTION` (
INDEX `fk_AP_ROLE_SUBSCRIPTION_AP_APP_RELEASE1_idx` (`AP_APP_RELEASE_ID` ASC, `AP_APP_ID` ASC),
CONSTRAINT `fk_AP_ROLE_SUBSCRIPTION_AP_APP_RELEASE1`
FOREIGN KEY (`AP_APP_RELEASE_ID` , `AP_APP_ID`)
REFERENCES `AP_APP_RELEASE` (`ID` , `AP_APP_ID`)
REFERENCES `APP_MANAGER`.`AP_APP_RELEASE` (`ID` , `AP_APP_ID`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `AP_UNRESTRICTED_ROLE`
-- Table `APP_MANAGER`.`AP_UNRESTRICTED_ROLE`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `AP_UNRESTRICTED_ROLE` (
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_UNRESTRICTED_ROLE` (
`ID` INT(11) NOT NULL AUTO_INCREMENT,
`TENANT_ID` VARCHAR(45) NOT NULL,
`ROLE` VARCHAR(45) NOT NULL,
@ -210,17 +289,17 @@ CREATE TABLE IF NOT EXISTS `AP_UNRESTRICTED_ROLE` (
INDEX `fk_AP_APP_VISIBILITY_AP_APP1_idx` (`AP_APP_ID` ASC),
CONSTRAINT `fk_AP_APP_VISIBILITY_AP_APP1`
FOREIGN KEY (`AP_APP_ID`)
REFERENCES `AP_APP` (`ID`)
REFERENCES `APP_MANAGER`.`AP_APP` (`ID`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `AP_USER_SUBSCRIPTION`
-- Table `APP_MANAGER`.`AP_USER_SUBSCRIPTION`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `AP_USER_SUBSCRIPTION` (
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_USER_SUBSCRIPTION` (
`ID` INT(11) NOT NULL AUTO_INCREMENT,
`TENANT_ID` VARCHAR(45) NOT NULL,
`USER_NAME` VARCHAR(100) NOT NULL,
@ -235,31 +314,32 @@ CREATE TABLE IF NOT EXISTS `AP_USER_SUBSCRIPTION` (
INDEX `fk_AP_USER_SUBSCRIPTION_AP_APP_RELEASE1_idx` (`AP_APP_RELEASE_ID` ASC, `AP_APP_ID` ASC),
CONSTRAINT `fk_AP_USER_SUBSCRIPTION_AP_APP_RELEASE1`
FOREIGN KEY (`AP_APP_RELEASE_ID` , `AP_APP_ID`)
REFERENCES `AP_APP_RELEASE` (`ID` , `AP_APP_ID`)
REFERENCES `APP_MANAGER`.`AP_APP_RELEASE` (`ID` , `AP_APP_ID`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `AP_APP_CATEGORY`
-- Table `APP_MANAGER`.`AP_APP_CATEGORY`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `AP_APP_CATEGORY` (
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_APP_CATEGORY` (
`ID` INT(11) NOT NULL AUTO_INCREMENT,
`TENANT_ID` VARCHAR(45) NOT NULL,
`CATEGORY` VARCHAR(45) NOT NULL,
`CATEGORY_ICON` VARCHAR(45) NULL,
`TENANT_ID` VARCHAR(45) NULL,
PRIMARY KEY (`ID`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `AP_APP_TAG_MAPPING`
-- Table `APP_MANAGER`.`AP_APP_TAG_MAPPING`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `AP_APP_TAG_MAPPING` (
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_APP_TAG_MAPPING` (
`ID` INT(11) NOT NULL AUTO_INCREMENT,
`TENANT_ID` VARCHAR(45) NOT NULL,
`AP_APP_TAG_ID` INT(11) NOT NULL,
`AP_APP_ID` INT(11) NOT NULL,
PRIMARY KEY (`ID`),
@ -267,23 +347,24 @@ CREATE TABLE IF NOT EXISTS `AP_APP_TAG_MAPPING` (
INDEX `fk_AP_APP_TAG_copy1_AP_APP1_idx` (`AP_APP_ID` ASC),
CONSTRAINT `fk_AP_APP_TAG_copy1_AP_APP_TAG1`
FOREIGN KEY (`AP_APP_TAG_ID`)
REFERENCES `AP_APP_TAG` (`ID`)
REFERENCES `APP_MANAGER`.`AP_APP_TAG` (`ID`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_AP_APP_TAG_copy1_AP_APP1`
FOREIGN KEY (`AP_APP_ID`)
REFERENCES `AP_APP` (`ID`)
REFERENCES `APP_MANAGER`.`AP_APP` (`ID`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `AP_APP_CATEGORY_MAPPING`
-- Table `APP_MANAGER`.`AP_APP_CATEGORY_MAPPING`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `AP_APP_CATEGORY_MAPPING` (
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_APP_CATEGORY_MAPPING` (
`ID` INT(11) NOT NULL AUTO_INCREMENT,
`TENANT_ID` VARCHAR(45) NOT NULL,
`AP_APP_CATEGORY_ID` INT(11) NOT NULL,
`AP_APP_ID` INT(11) NOT NULL,
PRIMARY KEY (`ID`),
@ -291,16 +372,16 @@ CREATE TABLE IF NOT EXISTS `AP_APP_CATEGORY_MAPPING` (
INDEX `fk_AP_APP_CATEGORY_copy1_AP_APP1_idx` (`AP_APP_ID` ASC),
CONSTRAINT `fk_AP_APP_CATEGORY_copy1_AP_APP_CATEGORY1`
FOREIGN KEY (`AP_APP_CATEGORY_ID`)
REFERENCES `AP_APP_CATEGORY` (`ID`)
REFERENCES `APP_MANAGER`.`AP_APP_CATEGORY` (`ID`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_AP_APP_CATEGORY_copy1_AP_APP1`
FOREIGN KEY (`AP_APP_ID`)
REFERENCES `AP_APP` (`ID`)
REFERENCES `APP_MANAGER`.`AP_APP` (`ID`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
SET SQL_MODE=@OLD_SQL_MODE;

Loading…
Cancel
Save