forked from community/device-mgt-core
parent
51b001c236
commit
caf7cd133b
@ -1,58 +1,281 @@
|
|||||||
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[APPM_PLATFORM]') AND TYPE IN (N'U'))
|
-- -----------------------------------------------------
|
||||||
CREATE TABLE APPM_PLATFORM (
|
-- Table AP_APP
|
||||||
ID INT IDENTITY(1,1) NOT NULL UNIQUE,
|
-- -----------------------------------------------------
|
||||||
IDENTIFIER VARCHAR (100) NOT NULL,
|
CREATE TABLE IF NOT EXISTS AP_APP(
|
||||||
TENANT_ID INT NOT NULL ,
|
ID INTEGER NOT NULL AUTO_INCREMENT,
|
||||||
NAME VARCHAR (255),
|
NAME VARCHAR(45) NOT NULL,
|
||||||
FILE_BASED BIT,
|
DESCRIPTION CLOB NULL,
|
||||||
DESCRIPTION VARCHAR(2048),
|
TYPE VARCHAR(200) NOT NULL,
|
||||||
IS_SHARED BIT,
|
TENANT_ID INTEGER NOT NULL,
|
||||||
IS_DEFAULT_TENANT_MAPPING BIT,
|
STATUS VARCHAR(45) NOT NULL DEFAULT 'ACTIVE',
|
||||||
ICON_NAME VARCHAR (100),
|
SUB_TYPE VARCHAR(45) NOT NULL,
|
||||||
PRIMARY KEY (ID)
|
CURRENCY VARCHAR(45) NULL DEFAULT '$',
|
||||||
);
|
RATING DOUBLE NULL DEFAULT NULL,
|
||||||
|
DEVICE_TYPE_ID INTEGER NOT NULL,
|
||||||
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[APPM_PLATFORM_PROPERTIES]') AND TYPE IN (N'U'))
|
PRIMARY KEY (ID)
|
||||||
CREATE TABLE APPM_PLATFORM_PROPERTIES (
|
);
|
||||||
ID INT IDENTITY(1,1) NOT NULL,
|
|
||||||
PLATFORM_ID INT NOT NULL,
|
-- -----------------------------------------------------
|
||||||
PROP_NAME VARCHAR (100) NOT NULL,
|
-- Table AP_APP_RELEASE
|
||||||
OPTIONAL BIT,
|
-- -----------------------------------------------------
|
||||||
DEFAUL_VALUE VARCHAR (255),
|
CREATE TABLE AP_APP_RELEASE(
|
||||||
FOREIGN KEY(PLATFORM_ID) REFERENCES APPM_PLATFORM(ID) ON DELETE CASCADE,
|
ID INTEGER NOT NULL IDENTITY,
|
||||||
PRIMARY KEY (ID, PLATFORM_ID, PROP_NAME)
|
DESCRIPTION VARCHAR(max) NOT NULL,
|
||||||
);
|
VERSION VARCHAR(70) NOT NULL,
|
||||||
|
TENANT_ID INTEGER NOT NULL,
|
||||||
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[APPM_PLATFORM_TENANT_MAPPING]') AND TYPE IN (N'U'))
|
UUID VARCHAR(200) NOT NULL,
|
||||||
CREATE TABLE APPM_PLATFORM_TENANT_MAPPING (
|
RELEASE_TYPE VARCHAR(45) NOT NULL,
|
||||||
ID INT IDENTITY(1,1) NOT NULL,
|
PACKAGE_NAME VARCHAR(45) NOT NULL,
|
||||||
TENANT_ID INT NOT NULL ,
|
APP_PRICE DECIMAL(6, 2) NULL DEFAULT NULL,
|
||||||
PLATFORM_ID INT NOT NULL,
|
INSTALLER_LOCATION VARCHAR(100) NOT NULL,
|
||||||
FOREIGN KEY(PLATFORM_ID) REFERENCES APPM_PLATFORM(ID) ON DELETE CASCADE,
|
ICON_LOCATION VARCHAR(100) NOT NULL,
|
||||||
PRIMARY KEY (ID, TENANT_ID, PLATFORM_ID)
|
BANNER_LOCATION VARCHAR(100) NULL DEFAULT NULL,
|
||||||
);
|
SC_1_LOCATION VARCHAR(100) NOT NULL,
|
||||||
|
SC_2_LOCATION VARCHAR(100) NULL DEFAULT NULL,
|
||||||
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[APPM_PLATFORM_TAG]') AND TYPE IN (N'U'))
|
SC_3_LOCATION VARCHAR(100) NULL DEFAULT NULL,
|
||||||
CREATE TABLE APPM_PLATFORM_TAG (
|
APP_HASH_VALUE VARCHAR(1000) NOT NULL,
|
||||||
NAME VARCHAR (100) NOT NULL ,
|
SHARED_WITH_ALL_TENANTS BIT NOT NULL DEFAULT FALSE,
|
||||||
PLATFORM_ID INT NOT NULL,
|
APP_META_INFO VARCHAR(max) NULL DEFAULT NULL,
|
||||||
FOREIGN KEY(PLATFORM_ID) REFERENCES APPM_PLATFORM(ID) ON DELETE CASCADE,
|
SUPPORTED_OS_VERSIONS VARCHAR(45) NOT NULL,
|
||||||
PRIMARY KEY (PLATFORM_ID, NAME)
|
RATING FLOAT NULL DEFAULT NULL,
|
||||||
);
|
CURRENT_STATE VARCHAR(45) NOT NULL,
|
||||||
|
RATED_USERS INTEGER NULL,
|
||||||
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[AP_SCHEDULED_SUBSCRIPTION]') AND TYPE IN (N'U'))
|
AP_APP_ID INTEGER NOT NULL,
|
||||||
|
PRIMARY KEY (ID),
|
||||||
|
CONSTRAINT fk_AP_APP_RELEASE_AP_APP1
|
||||||
|
FOREIGN KEY (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 AP_APP_REVIEW(
|
||||||
|
ID INTEGER NOT NULL IDENTITY,
|
||||||
|
TENANT_ID INTEGER NOT NULL,
|
||||||
|
COMMENT VARCHAR(max) NOT NULL,
|
||||||
|
ROOT_PARENT_ID INTEGER NOT NULL,
|
||||||
|
IMMEDIATE_PARENT_ID INTEGER NOT NULL,
|
||||||
|
CREATED_AT DATETIME2(0) NOT NULL,
|
||||||
|
MODIFIED_AT DATETIME2(0) NOT NULL,
|
||||||
|
RATING INTEGER NULL,
|
||||||
|
USERNAME VARCHAR(45) NOT NULL,
|
||||||
|
ACTIVE_REVIEW BIT NOT NULL DEFAULT TRUE,
|
||||||
|
AP_APP_RELEASE_ID INTEGER NOT NULL,
|
||||||
|
PRIMARY KEY (ID),
|
||||||
|
CONSTRAINT fk_AP_APP_COMMENT_AP_APP_RELEASE1
|
||||||
|
FOREIGN KEY (AP_APP_RELEASE_ID)
|
||||||
|
REFERENCES AP_APP_RELEASE (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);
|
||||||
|
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
-- Table AP_APP_LIFECYCLE_STATE
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
CREATE TABLE AP_APP_LIFECYCLE_STATE(
|
||||||
|
ID INTEGER NOT NULL IDENTITY,
|
||||||
|
CURRENT_STATE VARCHAR(45) NOT NULL,
|
||||||
|
PREVIOUS_STATE VARCHAR(45) NOT NULL,
|
||||||
|
TENANT_ID INTEGER NOT NULL,
|
||||||
|
UPDATED_BY VARCHAR(100) NOT NULL,
|
||||||
|
UPDATED_AT DATETIME2(0) NOT NULL,
|
||||||
|
AP_APP_RELEASE_ID INTEGER NOT NULL,
|
||||||
|
REASON VARCHAR(max) DEFAULT NULL,
|
||||||
|
PRIMARY KEY (ID),
|
||||||
|
CONSTRAINT fk_AP_APP_LIFECYCLE_STATE_AP_APP_RELEASE1
|
||||||
|
FOREIGN KEY (AP_APP_RELEASE_ID)
|
||||||
|
REFERENCES AP_APP_RELEASE (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);
|
||||||
|
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
-- Table AP_APP_TAG
|
||||||
|
-- ----------------------------------------------------
|
||||||
|
CREATE TABLE AP_APP_TAG(
|
||||||
|
ID INTEGER NOT NULL IDENTITY,
|
||||||
|
TENANT_ID INTEGER NOT NULL,
|
||||||
|
TAG VARCHAR(100) NOT NULL,
|
||||||
|
PRIMARY KEY (ID)
|
||||||
|
);
|
||||||
|
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
-- Table AP_DEVICE_SUBSCRIPTION
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
CREATE TABLE AP_DEVICE_SUBSCRIPTION(
|
||||||
|
ID INTEGER NOT NULL IDENTITY,
|
||||||
|
TENANT_ID INTEGER NOT NULL,
|
||||||
|
SUBSCRIBED_BY VARCHAR(100) NOT NULL,
|
||||||
|
SUBSCRIBED_TIMESTAMP DATETIME2(0) NOT NULL,
|
||||||
|
UNSUBSCRIBED BIT NULL DEFAULT NULL,
|
||||||
|
UNSUBSCRIBED_BY VARCHAR(100) NULL DEFAULT NULL,
|
||||||
|
UNSUBSCRIBED_TIMESTAMP DATETIME2(0) NULL DEFAULT NULL,
|
||||||
|
ACTION_TRIGGERED_FROM VARCHAR(45) NOT NULL,
|
||||||
|
STATUS VARCHAR(45) NOT NULL,
|
||||||
|
DM_DEVICE_ID INTEGER NOT NULL,
|
||||||
|
AP_APP_RELEASE_ID INTEGER NOT NULL,
|
||||||
|
PRIMARY KEY (ID),
|
||||||
|
CONSTRAINT fk_AP_DEVICE_SUBSCRIPTION_AP_APP_RELEASE1
|
||||||
|
FOREIGN KEY (AP_APP_RELEASE_ID)
|
||||||
|
REFERENCES AP_APP_RELEASE (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);
|
||||||
|
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
-- Table AP_GROUP_SUBSCRIPTION
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
CREATE TABLE AP_GROUP_SUBSCRIPTION(
|
||||||
|
ID INTEGER NOT NULL IDENTITY,
|
||||||
|
TENANT_ID INTEGER NOT NULL,
|
||||||
|
SUBSCRIBED_BY VARCHAR(100) NOT NULL,
|
||||||
|
SUBSCRIBED_TIMESTAMP DATETIME2(0) NOT NULL,
|
||||||
|
UNSUBSCRIBED BIT NULL DEFAULT NULL,
|
||||||
|
UNSUBSCRIBED_BY VARCHAR(100) NULL DEFAULT NULL,
|
||||||
|
UNSUBSCRIBED_TIMESTAMP DATETIME2(0) NULL DEFAULT NULL,
|
||||||
|
GROUP_NAME VARCHAR(100) NOT NULL,
|
||||||
|
AP_APP_RELEASE_ID INTEGER NOT NULL,
|
||||||
|
PRIMARY KEY (ID),
|
||||||
|
CONSTRAINT fk_AP_GROUP_SUBSCRIPTION_AP_APP_RELEASE1
|
||||||
|
FOREIGN KEY (AP_APP_RELEASE_ID)
|
||||||
|
REFERENCES AP_APP_RELEASE (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);
|
||||||
|
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
-- Table AP_ROLE_SUBSCRIPTION
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
CREATE TABLE AP_ROLE_SUBSCRIPTION(
|
||||||
|
ID INTEGER NOT NULL IDENTITY,
|
||||||
|
TENANT_ID INTEGER NOT NULL,
|
||||||
|
ROLE_NAME VARCHAR(100) NOT NULL,
|
||||||
|
SUBSCRIBED_BY VARCHAR(100) NOT NULL,
|
||||||
|
SUBSCRIBED_TIMESTAMP DATETIME2(0) NOT NULL,
|
||||||
|
UNSUBSCRIBED BIT NULL DEFAULT NULL,
|
||||||
|
UNSUBSCRIBED_BY VARCHAR(100) NULL DEFAULT NULL,
|
||||||
|
UNSUBSCRIBED_TIMESTAMP DATETIME2(0) NULL DEFAULT NULL,
|
||||||
|
AP_APP_RELEASE_ID INTEGER NOT NULL,
|
||||||
|
PRIMARY KEY (ID),
|
||||||
|
CONSTRAINT fk_AP_ROLE_SUBSCRIPTION_AP_APP_RELEASE1
|
||||||
|
FOREIGN KEY (AP_APP_RELEASE_ID)
|
||||||
|
REFERENCES AP_APP_RELEASE (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);
|
||||||
|
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
-- Table AP_UNRESTRICTED_ROLE
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
CREATE TABLE AP_UNRESTRICTED_ROLE(
|
||||||
|
ID INTEGER NOT NULL IDENTITY,
|
||||||
|
TENANT_ID INTEGER NOT NULL,
|
||||||
|
ROLE VARCHAR(45) 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) 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 AP_USER_SUBSCRIPTION(
|
||||||
|
ID INTEGER NOT NULL IDENTITY,
|
||||||
|
TENANT_ID INTEGER NOT NULL,
|
||||||
|
USER_NAME VARCHAR(100) NOT NULL,
|
||||||
|
SUBSCRIBED_BY VARCHAR(100) NOT NULL,
|
||||||
|
SUBSCRIBED_TIMESTAMP DATETIME2(0) NOT NULL,
|
||||||
|
UNSUBSCRIBED BIT NULL DEFAULT NULL,
|
||||||
|
UNSUBSCRIBED_BY VARCHAR(100) NULL DEFAULT NULL,
|
||||||
|
UNSUBSCRIBED_TIMESTAMP DATETIME2(0) NULL DEFAULT NULL,
|
||||||
|
AP_APP_RELEASE_ID INTEGER NOT NULL,
|
||||||
|
PRIMARY KEY (ID),
|
||||||
|
CONSTRAINT fk_AP_USER_SUBSCRIPTION_AP_APP_RELEASE1
|
||||||
|
FOREIGN KEY (AP_APP_RELEASE_ID)
|
||||||
|
REFERENCES AP_APP_RELEASE (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);
|
||||||
|
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
-- Table AP_APP_CATEGORY
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
CREATE TABLE AP_APP_CATEGORY(
|
||||||
|
ID INTEGER NOT NULL IDENTITY,
|
||||||
|
TENANT_ID INTEGER NOT NULL,
|
||||||
|
CATEGORY VARCHAR(45) NOT NULL,
|
||||||
|
CATEGORY_ICON VARCHAR(45) NULL,
|
||||||
|
PRIMARY KEY (ID)
|
||||||
|
);
|
||||||
|
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
-- Table AP_APP_TAG_MAPPING
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
CREATE TABLE AP_APP_TAG_MAPPING(
|
||||||
|
ID INTEGER NOT NULL IDENTITY,
|
||||||
|
TENANT_ID INTEGER NOT NULL,
|
||||||
|
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) 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) 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 AP_APP_CATEGORY_MAPPING(
|
||||||
|
ID INTEGER NOT NULL IDENTITY,
|
||||||
|
TENANT_ID INTEGER NOT NULL,
|
||||||
|
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) 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) 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);
|
||||||
|
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
-- Table AP_APP_SUB_OP_MAPPING
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
CREATE TABLE AP_APP_SUB_OP_MAPPING (
|
||||||
|
ID INTEGER NOT NULL IDENTITY,
|
||||||
|
TENANT_ID INTEGER NOT NULL,
|
||||||
|
OPERATION_ID INTEGER NOT NULL,
|
||||||
|
AP_DEVICE_SUBSCRIPTION_ID INTEGER NOT NULL,
|
||||||
|
PRIMARY KEY (ID),
|
||||||
|
CONSTRAINT fk_AP_APP_SUB_OP_MAPPING_AP_DEVICE_SUBSCRIPTION1
|
||||||
|
FOREIGN KEY (AP_DEVICE_SUBSCRIPTION_ID)
|
||||||
|
REFERENCES AP_DEVICE_SUBSCRIPTION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||||
|
);
|
||||||
|
CREATE INDEX fk_AP_APP_SUB_OP_MAPPING_AP_DEVICE_SUBSCRIPTION1_idx ON AP_APP_SUB_OP_MAPPING (AP_DEVICE_SUBSCRIPTION_ID ASC);
|
||||||
|
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
-- Table AP_SCHEDULED_SUBSCRIPTION
|
||||||
|
-- -----------------------------------------------------
|
||||||
CREATE TABLE AP_SCHEDULED_SUBSCRIPTION(
|
CREATE TABLE AP_SCHEDULED_SUBSCRIPTION(
|
||||||
ID INT IDENTITY(1, 1) NOT NULL,
|
ID INTEGER NOT NULL IDENTITY,
|
||||||
TASK_NAME VARCHAR(100) NOT NULL,
|
TASK_NAME VARCHAR(100) NOT NULL,
|
||||||
APPLICATION_UUID VARCHAR(36) NOT NULL,
|
APPLICATION_UUID VARCHAR(36) NOT NULL,
|
||||||
SUBSCRIBER_LIST VARCHAR(MAX) NOT NULL,
|
SUBSCRIBER_LIST LONGVARCHAR NOT NULL,
|
||||||
STATUS VARCHAR(15) NOT NULL,
|
STATUS VARCHAR(15) NOT NULL,
|
||||||
SCHEDULED_AT DATETIME NOT NULL,
|
SCHEDULED_AT DATETIME2(0) NOT NULL,
|
||||||
SCHEDULED_BY VARCHAR(100) NOT NULL,
|
SCHEDULED_BY VARCHAR(100) NOT NULL,
|
||||||
SCHEDULED_TIMESTAMP DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
SCHEDULED_TIMESTAMP DATETIME2(0) NOT NULL,
|
||||||
DELETED BIT NULL,
|
DELETED BIT,
|
||||||
PRIMARY KEY (ID),
|
PRIMARY KEY (ID),
|
||||||
FOREIGN KEY (APPLICATION_UUID) REFERENCES AP_APP_RELEASE (UUID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
CONSTRAINT fk_AP_SCHEDULED_SUBSCRIPTION_AP_APP_RELEASE
|
||||||
)
|
FOREIGN KEY (APPLICATION_UUID)
|
||||||
|
REFERENCES AP_APP_RELEASE (UUID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||||
CREATE INDEX FK_PLATFROM_TENANT_MAPPING_PLATFORM ON APPM_PLATFORM_TENANT_MAPPING(PLATFORM_ID ASC);
|
);
|
@ -1,354 +1,280 @@
|
|||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table `APP_MANAGER`.`AP_APP`
|
-- Table AP_APP
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_APP`
|
CREATE TABLE IF NOT EXISTS AP_APP(
|
||||||
(
|
ID INTEGER NOT NULL AUTO_INCREMENT,
|
||||||
`ID` INT(11) NOT NULL,
|
NAME VARCHAR(45) NOT NULL,
|
||||||
`NAME` VARCHAR(45) NOT NULL,
|
DESCRIPTION CLOB NULL,
|
||||||
`DESCRIPTION` TEXT NULL,
|
TYPE VARCHAR(200) NOT NULL,
|
||||||
`TYPE` VARCHAR(200) NOT NULL,
|
TENANT_ID INTEGER NOT NULL,
|
||||||
`TENANT_ID` INT(11) NOT NULL,
|
STATUS VARCHAR(45) NOT NULL DEFAULT 'ACTIVE',
|
||||||
`STATUS` VARCHAR(45) NOT NULL DEFAULT 'ACTIVE ',
|
SUB_TYPE VARCHAR(45) NOT NULL,
|
||||||
`SUB_TYPE` VARCHAR(45) NOT NULL,
|
CURRENCY VARCHAR(45) NULL DEFAULT '$',
|
||||||
`CURRENCY` VARCHAR(45) NULL DEFAULT '$',
|
RATING DOUBLE NULL DEFAULT NULL,
|
||||||
`RATING` INT(11) NULL,
|
DEVICE_TYPE_ID INTEGER NOT NULL,
|
||||||
`DEVICE_TYPE_ID` INT(11) NOT NULL,
|
PRIMARY KEY (ID)
|
||||||
PRIMARY KEY (`ID`)
|
);
|
||||||
)
|
|
||||||
ENGINE = InnoDB
|
|
||||||
DEFAULT CHARACTER SET = utf8;
|
|
||||||
|
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table `APP_MANAGER`.`AP_APP_RELEASE`
|
-- Table AP_APP_RELEASE
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_APP_RELEASE`
|
CREATE TABLE IF NOT EXISTS AP_APP_RELEASE(
|
||||||
(
|
ID INTEGER NOT NULL AUTO_INCREMENT,
|
||||||
`ID` INT(11) NOT NULL,
|
DESCRIPTION CLOB NOT NULL,
|
||||||
`DESCRIPTION` TEXT NOT NULL,
|
VERSION VARCHAR(70) NOT NULL,
|
||||||
`VERSION` VARCHAR(70) NOT NULL,
|
TENANT_ID INTEGER NOT NULL,
|
||||||
`TENANT_ID` INT(11) NOT NULL,
|
UUID VARCHAR(200) NOT NULL,
|
||||||
`UUID` VARCHAR(200) NOT NULL,
|
RELEASE_TYPE VARCHAR(45) 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,
|
||||||
`STORED_LOCATION` VARCHAR(45) NOT NULL,
|
INSTALLER_LOCATION VARCHAR(100) NOT NULL,
|
||||||
`BANNER_LOCATION` VARCHAR(45) NOT NULL,
|
ICON_LOCATION VARCHAR(100) NOT NULL,
|
||||||
`SC_1_LOCATION` VARCHAR(45) NOT NULL,
|
BANNER_LOCATION VARCHAR(100) NULL DEFAULT NULL,
|
||||||
`SC_2_LOCATION` VARCHAR(45) NULL DEFAULT NULL,
|
SC_1_LOCATION VARCHAR(100) NOT NULL,
|
||||||
`SC_3_LOCATION` VARCHAR(45) NULL DEFAULT NULL,
|
SC_2_LOCATION VARCHAR(100) NULL DEFAULT NULL,
|
||||||
`APP_HASH_VALUE` VARCHAR(1000) NOT NULL,
|
SC_3_LOCATION VARCHAR(100) NULL DEFAULT NULL,
|
||||||
`SHARED_WITH_ALL_TENANTS` TINYINT(1) NULL DEFAULT NULL,
|
APP_HASH_VALUE VARCHAR(1000) NOT NULL,
|
||||||
`APP_META_INFO` TEXT NULL DEFAULT NULL,
|
SHARED_WITH_ALL_TENANTS BOOLEAN NOT NULL DEFAULT FALSE,
|
||||||
`PACKAGE_NAME` VARCHAR(45) NOT NULL,
|
APP_META_INFO CLOB NULL DEFAULT NULL,
|
||||||
`SUPPORTED_OS_VERSIONS` VARCHAR(45) NULL,
|
SUPPORTED_OS_VERSIONS VARCHAR(45) NOT NULL,
|
||||||
`RATING` DOUBLE NULL DEFAULT NULL,
|
RATING DOUBLE NULL DEFAULT NULL,
|
||||||
`CURRENT_STATE` VARCHAR(45) NULL,
|
CURRENT_STATE VARCHAR(45) NOT NULL,
|
||||||
`RATED_USERS` INT(11) NULL,
|
RATED_USERS INTEGER NULL,
|
||||||
`AP_APP_ID` INT(11) NOT NULL,
|
AP_APP_ID INTEGER NOT NULL,
|
||||||
PRIMARY KEY (`ID`),
|
PRIMARY KEY (ID),
|
||||||
INDEX `fk_AP_APP_RELEASE_AP_APP1_idx` (`AP_APP_ID` ASC),
|
CONSTRAINT fk_AP_APP_RELEASE_AP_APP1
|
||||||
CONSTRAINT `fk_AP_APP_RELEASE_AP_APP1`
|
FOREIGN KEY (AP_APP_ID)
|
||||||
FOREIGN KEY (`AP_APP_ID`)
|
REFERENCES AP_APP (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||||
REFERENCES `APP_MANAGER`.`AP_APP` (`ID`)
|
);
|
||||||
ON DELETE NO ACTION
|
CREATE INDEX fk_AP_APP_RELEASE_AP_APP1_idx ON AP_APP_RELEASE (AP_APP_ID ASC);
|
||||||
ON UPDATE NO ACTION
|
|
||||||
)
|
|
||||||
ENGINE = InnoDB
|
|
||||||
DEFAULT CHARACTER SET = utf8;
|
|
||||||
|
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table `APP_MANAGER`.`AP_APP_REVIEW`
|
-- Table AP_APP_REVIEW
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_APP_REVIEW`
|
CREATE TABLE IF NOT EXISTS AP_APP_REVIEW(
|
||||||
(
|
ID INTEGER NOT NULL AUTO_INCREMENT,
|
||||||
`ID` INT(11) NOT NULL,
|
TENANT_ID INTEGER NOT NULL,
|
||||||
`TENANT_ID` INT(11) NOT NULL,
|
COMMENT TEXT NOT NULL,
|
||||||
`COMMENT` TEXT NOT NULL,
|
ROOT_PARENT_ID INTEGER NOT NULL,
|
||||||
`ROOT_PARENT_ID` INT(11) NOT NULL,
|
IMMEDIATE_PARENT_ID INTEGER NOT NULL,
|
||||||
`IMMEDIATE_PARENT_ID` INT(11) NOT NULL,
|
CREATED_AT TIMESTAMP NOT NULL,
|
||||||
`CREATED_AT` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
MODIFIED_AT TIMESTAMP NOT NULL,
|
||||||
`MODIFIED_AT` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
RATING INTEGER NULL,
|
||||||
`RATING` INT(11) NOT NULL,
|
USERNAME VARCHAR(45) NOT NULL,
|
||||||
`USERNAME` VARCHAR(45) NOT NULL,
|
ACTIVE_REVIEW BOOLEAN NOT NULL DEFAULT TRUE,
|
||||||
`AP_APP_RELEASE_ID` INT(11) NOT NULL,
|
AP_APP_RELEASE_ID INTEGER NOT NULL,
|
||||||
PRIMARY KEY (`ID`),
|
PRIMARY KEY (ID),
|
||||||
INDEX `fk_AP_APP_REVIEW_AP_APP_RELEASE1_idx` (`AP_APP_RELEASE_ID` ASC),
|
CONSTRAINT fk_AP_APP_COMMENT_AP_APP_RELEASE1
|
||||||
CONSTRAINT `fk_AP_APP_REVIEW_AP_APP_RELEASE1`
|
FOREIGN KEY (AP_APP_RELEASE_ID)
|
||||||
FOREIGN KEY (`AP_APP_RELEASE_ID`)
|
REFERENCES AP_APP_RELEASE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||||
REFERENCES `APP_MANAGER`.`AP_APP_RELEASE` (`ID`)
|
);
|
||||||
ON DELETE NO ACTION
|
CREATE INDEX fk_AP_APP_COMMENT_AP_APP_RELEASE1_idx ON AP_APP_REVIEW (AP_APP_RELEASE_ID ASC);
|
||||||
ON UPDATE NO ACTION
|
|
||||||
)
|
|
||||||
ENGINE = InnoDB
|
|
||||||
DEFAULT CHARACTER SET = utf8;
|
|
||||||
|
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table `APP_MANAGER`.`AP_APP_LIFECYCLE_STATE`
|
-- Table AP_APP_LIFECYCLE_STATE
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_APP_LIFECYCLE_STATE`
|
CREATE TABLE IF NOT EXISTS AP_APP_LIFECYCLE_STATE(
|
||||||
(
|
ID INTEGER NOT NULL AUTO_INCREMENT,
|
||||||
`ID` INT(11) NOT NULL,
|
CURRENT_STATE VARCHAR(45) NOT NULL,
|
||||||
`CURRENT_STATE` VARCHAR(45) NOT NULL,
|
PREVIOUS_STATE VARCHAR(45) NOT NULL,
|
||||||
`PREVIOUS_STATE` VARCHAR(45) NOT NULL,
|
TENANT_ID INTEGER NOT NULL,
|
||||||
`TENANT_ID` INT(11) NOT NULL,
|
UPDATED_BY VARCHAR(100) NOT NULL,
|
||||||
`UPDATED_BY` VARCHAR(100) NOT NULL,
|
UPDATED_AT TIMESTAMP NOT NULL,
|
||||||
`UPDATED_AT` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
AP_APP_RELEASE_ID INTEGER NOT NULL,
|
||||||
`REASON` VARCHAR(45) NULL,
|
REASON TEXT DEFAULT NULL,
|
||||||
`AP_APP_RELEASE_ID` INT(11) NOT NULL,
|
PRIMARY KEY (ID),
|
||||||
PRIMARY KEY (`ID`),
|
CONSTRAINT fk_AP_APP_LIFECYCLE_STATE_AP_APP_RELEASE1
|
||||||
INDEX `fk_AP_APP_LIFECYCLE_STATE_AP_APP_RELEASE1_idx` (`AP_APP_RELEASE_ID` ASC),
|
FOREIGN KEY (AP_APP_RELEASE_ID)
|
||||||
CONSTRAINT `fk_AP_APP_LIFECYCLE_STATE_AP_APP_RELEASE1`
|
REFERENCES AP_APP_RELEASE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||||
FOREIGN KEY (`AP_APP_RELEASE_ID`)
|
);
|
||||||
REFERENCES `APP_MANAGER`.`AP_APP_RELEASE` (`ID`)
|
CREATE INDEX fk_AP_APP_LIFECYCLE_STATE_AP_APP_RELEASE1_idx ON AP_APP_LIFECYCLE_STATE( AP_APP_RELEASE_ID ASC);
|
||||||
ON DELETE NO ACTION
|
|
||||||
ON UPDATE NO ACTION
|
|
||||||
)
|
|
||||||
ENGINE = InnoDB
|
|
||||||
DEFAULT CHARACTER SET = utf8;
|
|
||||||
|
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table `APP_MANAGER`.`AP_APP_TAG`
|
-- Table AP_APP_TAG
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_APP_TAG`
|
CREATE TABLE IF NOT EXISTS AP_APP_TAG(
|
||||||
(
|
ID INTEGER NOT NULL AUTO_INCREMENT,
|
||||||
`ID` INT(11) NOT NULL,
|
TENANT_ID INTEGER NOT NULL,
|
||||||
`TAG` VARCHAR(100) NOT NULL,
|
TAG VARCHAR(100) NOT NULL,
|
||||||
`TENANT_ID` INT(11) NOT NULL,
|
PRIMARY KEY (ID)
|
||||||
PRIMARY KEY (`ID`)
|
);
|
||||||
)
|
|
||||||
ENGINE = InnoDB
|
|
||||||
DEFAULT CHARACTER SET = utf8;
|
|
||||||
|
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table `APP_MANAGER`.`AP_DEVICE_SUBSCRIPTION`
|
-- Table AP_DEVICE_SUBSCRIPTION
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_DEVICE_SUBSCRIPTION`
|
CREATE TABLE IF NOT EXISTS AP_DEVICE_SUBSCRIPTION(
|
||||||
(
|
ID INTEGER NOT NULL AUTO_INCREMENT,
|
||||||
`ID` INT(11) NOT NULL,
|
TENANT_ID INTEGER NOT NULL,
|
||||||
`TENANT_ID` INT(11) NOT NULL,
|
SUBSCRIBED_BY VARCHAR(100) NOT NULL,
|
||||||
`SUBSCRIBED_BY` VARCHAR(100) NOT NULL,
|
SUBSCRIBED_TIMESTAMP TIMESTAMP NOT NULL,
|
||||||
`SUBSCRIBED_TIMESTAMP` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
UNSUBSCRIBED BOOLEAN NULL DEFAULT NULL,
|
||||||
`UNSUBSCRIBED` TINYINT(1) NULL DEFAULT NULL,
|
UNSUBSCRIBED_BY VARCHAR(100) NULL DEFAULT NULL,
|
||||||
`UNSUBSCRIBED_BY` VARCHAR(100) NULL DEFAULT NULL,
|
UNSUBSCRIBED_TIMESTAMP TIMESTAMP NULL DEFAULT NULL,
|
||||||
`UNSUBSCRIBED_TIMESTAMP` TIMESTAMP NULL DEFAULT NULL,
|
ACTION_TRIGGERED_FROM VARCHAR(45) NOT NULL,
|
||||||
`ACTION_TRIGGERED_FROM` VARCHAR(45) NULL,
|
STATUS VARCHAR(45) NOT NULL,
|
||||||
`DM_DEVICE_ID` INT(11) NOT NULL,
|
DM_DEVICE_ID INTEGER NOT NULL,
|
||||||
`AP_APP_RELEASE_ID` INT(11) NOT NULL,
|
AP_APP_RELEASE_ID INTEGER NOT NULL,
|
||||||
PRIMARY KEY (`ID`),
|
PRIMARY KEY (ID),
|
||||||
INDEX `fk_AP_DEVICE_SUBSCRIPTION_AP_APP_RELEASE1_idx` (`AP_APP_RELEASE_ID` ASC),
|
CONSTRAINT fk_AP_DEVICE_SUBSCRIPTION_AP_APP_RELEASE1
|
||||||
CONSTRAINT `fk_AP_DEVICE_SUBSCRIPTION_AP_APP_RELEASE1`
|
FOREIGN KEY (AP_APP_RELEASE_ID)
|
||||||
FOREIGN KEY (`AP_APP_RELEASE_ID`)
|
REFERENCES AP_APP_RELEASE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||||
REFERENCES `APP_MANAGER`.`AP_APP_RELEASE` (`ID`)
|
);
|
||||||
ON DELETE NO ACTION
|
CREATE INDEX fk_AP_DEVICE_SUBSCRIPTION_AP_APP_RELEASE1_idx ON AP_DEVICE_SUBSCRIPTION (AP_APP_RELEASE_ID ASC);
|
||||||
ON UPDATE NO ACTION
|
|
||||||
)
|
|
||||||
ENGINE = InnoDB
|
|
||||||
DEFAULT CHARACTER SET = utf8;
|
|
||||||
|
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table `APP_MANAGER`.`AP_GROUP_SUBSCRIPTION`
|
-- Table AP_GROUP_SUBSCRIPTION
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_GROUP_SUBSCRIPTION`
|
CREATE TABLE IF NOT EXISTS AP_GROUP_SUBSCRIPTION(
|
||||||
(
|
ID INTEGER NOT NULL AUTO_INCREMENT,
|
||||||
`ID` INT(11) NOT NULL,
|
TENANT_ID INTEGER NOT NULL,
|
||||||
`TENANT_ID` INT(11) NOT NULL,
|
SUBSCRIBED_BY VARCHAR(100) NOT NULL,
|
||||||
`SUBSCRIBED_BY` VARCHAR(100) NOT NULL,
|
SUBSCRIBED_TIMESTAMP TIMESTAMP NOT NULL,
|
||||||
`SUBSCRIBED_TIMESTAMP` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
UNSUBSCRIBED BOOLEAN NULL DEFAULT NULL,
|
||||||
`UNSUBSCRIBED` TINYINT(1) NULL DEFAULT NULL,
|
UNSUBSCRIBED_BY VARCHAR(100) NULL DEFAULT NULL,
|
||||||
`UNSUBSCRIBED_BY` VARCHAR(100) NULL DEFAULT NULL,
|
UNSUBSCRIBED_TIMESTAMP TIMESTAMP NULL DEFAULT NULL,
|
||||||
`UNSUBSCRIBED_TIMESTAMP` TIMESTAMP NULL DEFAULT NULL,
|
GROUP_NAME VARCHAR(100) NOT NULL,
|
||||||
`GROUP_NAME` VARCHAR(100) NOT NULL,
|
AP_APP_RELEASE_ID INTEGER NOT NULL,
|
||||||
`AP_APP_RELEASE_ID` INT(11) NOT NULL,
|
PRIMARY KEY (ID),
|
||||||
INDEX `fk_AP_GROUP_SUBSCRIPTION_AP_APP_RELEASE1_idx` (`AP_APP_RELEASE_ID` ASC),
|
CONSTRAINT fk_AP_GROUP_SUBSCRIPTION_AP_APP_RELEASE1
|
||||||
PRIMARY KEY (`ID`),
|
FOREIGN KEY (AP_APP_RELEASE_ID)
|
||||||
CONSTRAINT `fk_AP_GROUP_SUBSCRIPTION_AP_APP_RELEASE1`
|
REFERENCES AP_APP_RELEASE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||||
FOREIGN KEY (`AP_APP_RELEASE_ID`)
|
);
|
||||||
REFERENCES `APP_MANAGER`.`AP_APP_RELEASE` (`ID`)
|
CREATE INDEX fk_AP_GROUP_SUBSCRIPTION_AP_APP_RELEASE1_idx ON AP_GROUP_SUBSCRIPTION (AP_APP_RELEASE_ID ASC);
|
||||||
ON DELETE NO ACTION
|
|
||||||
ON UPDATE NO ACTION
|
|
||||||
)
|
|
||||||
ENGINE = InnoDB
|
|
||||||
DEFAULT CHARACTER SET = utf8;
|
|
||||||
|
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table `APP_MANAGER`.`AP_ROLE_SUBSCRIPTION`
|
-- Table AP_ROLE_SUBSCRIPTION
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_ROLE_SUBSCRIPTION`
|
CREATE TABLE IF NOT EXISTS AP_ROLE_SUBSCRIPTION(
|
||||||
(
|
ID INTEGER NOT NULL AUTO_INCREMENT,
|
||||||
`ID` INT(11) NOT NULL,
|
TENANT_ID INTEGER NOT NULL,
|
||||||
`TENANT_ID` INT(11) NOT NULL,
|
ROLE_NAME VARCHAR(100) NOT NULL,
|
||||||
`ROLE_NAME` VARCHAR(100) NOT NULL,
|
SUBSCRIBED_BY VARCHAR(100) NOT NULL,
|
||||||
`SUBSCRIBED_BY` VARCHAR(100) NOT NULL,
|
SUBSCRIBED_TIMESTAMP TIMESTAMP NOT NULL,
|
||||||
`SUBSCRIBED_TIMESTAMP` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
UNSUBSCRIBED BOOLEAN NULL DEFAULT NULL,
|
||||||
`UNSUBSCRIBED` TINYINT(1) NULL DEFAULT NULL,
|
UNSUBSCRIBED_BY VARCHAR(100) NULL DEFAULT NULL,
|
||||||
`UNSUBSCRIBED_BY` VARCHAR(100) NULL DEFAULT NULL,
|
UNSUBSCRIBED_TIMESTAMP TIMESTAMP NULL DEFAULT NULL,
|
||||||
`UNSUBSCRIBED_TIMESTAMP` TIMESTAMP NULL DEFAULT NULL,
|
AP_APP_RELEASE_ID INTEGER NOT NULL,
|
||||||
`AP_APP_RELEASE_ID` INT(11) NOT NULL,
|
PRIMARY KEY (ID),
|
||||||
PRIMARY KEY (`ID`),
|
CONSTRAINT fk_AP_ROLE_SUBSCRIPTION_AP_APP_RELEASE1
|
||||||
INDEX `fk_AP_ROLE_SUBSCRIPTION_AP_APP_RELEASE1_idx` (`AP_APP_RELEASE_ID` ASC),
|
FOREIGN KEY (AP_APP_RELEASE_ID)
|
||||||
CONSTRAINT `fk_AP_ROLE_SUBSCRIPTION_AP_APP_RELEASE1`
|
REFERENCES AP_APP_RELEASE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||||
FOREIGN KEY (`AP_APP_RELEASE_ID`)
|
);
|
||||||
REFERENCES `APP_MANAGER`.`AP_APP_RELEASE` (`ID`)
|
CREATE INDEX fk_AP_ROLE_SUBSCRIPTION_AP_APP_RELEASE1_idx ON AP_ROLE_SUBSCRIPTION (AP_APP_RELEASE_ID ASC);
|
||||||
ON DELETE NO ACTION
|
|
||||||
ON UPDATE NO ACTION
|
|
||||||
)
|
|
||||||
ENGINE = InnoDB
|
|
||||||
DEFAULT CHARACTER SET = utf8;
|
|
||||||
|
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table `APP_MANAGER`.`AP_UNRESTRICTED_ROLE`
|
-- Table AP_UNRESTRICTED_ROLE
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_UNRESTRICTED_ROLE`
|
CREATE TABLE IF NOT EXISTS AP_UNRESTRICTED_ROLE(
|
||||||
(
|
ID INTEGER NOT NULL AUTO_INCREMENT,
|
||||||
`ID` INT(11) NOT NULL,
|
TENANT_ID INTEGER NOT NULL,
|
||||||
`TENANT_ID` INT(11) NOT NULL,
|
ROLE VARCHAR(45) NOT NULL,
|
||||||
`ROLE` VARCHAR(100) NOT NULL,
|
AP_APP_ID INTEGER NOT NULL,
|
||||||
`AP_APP_ID` INT(11) NOT NULL,
|
PRIMARY KEY (ID),
|
||||||
PRIMARY KEY (`ID`),
|
CONSTRAINT fk_AP_APP_VISIBILITY_AP_APP1
|
||||||
INDEX `fk_AP_APP_VISIBILITY_AP_APP1_idx` (`AP_APP_ID` ASC),
|
FOREIGN KEY (AP_APP_ID)
|
||||||
CONSTRAINT `fk_AP_APP_VISIBILITY_AP_APP1`
|
REFERENCES AP_APP (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||||
FOREIGN KEY (`AP_APP_ID`)
|
);
|
||||||
REFERENCES `APP_MANAGER`.`AP_APP` (`ID`)
|
CREATE INDEX fk_AP_APP_VISIBILITY_AP_APP1_idx ON AP_UNRESTRICTED_ROLE (AP_APP_ID ASC);
|
||||||
ON DELETE NO ACTION
|
|
||||||
ON UPDATE NO ACTION
|
|
||||||
)
|
|
||||||
ENGINE = InnoDB
|
|
||||||
DEFAULT CHARACTER SET = utf8;
|
|
||||||
|
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table `APP_MANAGER`.`AP_USER_SUBSCRIPTION`
|
-- Table AP_USER_SUBSCRIPTION
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_USER_SUBSCRIPTION`
|
CREATE TABLE IF NOT EXISTS AP_USER_SUBSCRIPTION(
|
||||||
(
|
ID INTEGER NOT NULL AUTO_INCREMENT,
|
||||||
`ID` INT(11) NOT NULL,
|
TENANT_ID INTEGER NOT NULL,
|
||||||
`TENANT_ID` INT(11) NOT NULL,
|
USER_NAME VARCHAR(100) NOT NULL,
|
||||||
`USER_NAME` VARCHAR(100) NOT NULL,
|
SUBSCRIBED_BY VARCHAR(100) NOT NULL,
|
||||||
`SUBSCRIBED_BY` VARCHAR(100) NOT NULL,
|
SUBSCRIBED_TIMESTAMP TIMESTAMP NOT NULL,
|
||||||
`SUBSCRIBED_TIMESTAMP` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
UNSUBSCRIBED BOOLEAN NULL DEFAULT NULL,
|
||||||
`UNSUBSCRIBED` TINYINT(1) NULL DEFAULT NULL,
|
UNSUBSCRIBED_BY VARCHAR(100) NULL DEFAULT NULL,
|
||||||
`UNSUBSCRIBED_BY` VARCHAR(100) NULL DEFAULT NULL,
|
UNSUBSCRIBED_TIMESTAMP TIMESTAMP NULL DEFAULT NULL,
|
||||||
`UNSUBSCRIBED_TIMESTAMP` TIMESTAMP NULL DEFAULT NULL,
|
AP_APP_RELEASE_ID INTEGER NOT NULL,
|
||||||
`AP_APP_RELEASE_ID` INT(11) NOT NULL,
|
PRIMARY KEY (ID),
|
||||||
PRIMARY KEY (`ID`),
|
CONSTRAINT fk_AP_USER_SUBSCRIPTION_AP_APP_RELEASE1
|
||||||
INDEX `fk_AP_USER_SUBSCRIPTION_AP_APP_RELEASE1_idx` (`AP_APP_RELEASE_ID` ASC),
|
FOREIGN KEY (AP_APP_RELEASE_ID)
|
||||||
CONSTRAINT `fk_AP_USER_SUBSCRIPTION_AP_APP_RELEASE1`
|
REFERENCES AP_APP_RELEASE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||||
FOREIGN KEY (`AP_APP_RELEASE_ID`)
|
);
|
||||||
REFERENCES `APP_MANAGER`.`AP_APP_RELEASE` (`ID`)
|
CREATE INDEX fk_AP_USER_SUBSCRIPTION_AP_APP_RELEASE1_idx ON AP_USER_SUBSCRIPTION (AP_APP_RELEASE_ID ASC);
|
||||||
ON DELETE NO ACTION
|
|
||||||
ON UPDATE NO ACTION
|
|
||||||
)
|
|
||||||
ENGINE = InnoDB
|
|
||||||
DEFAULT CHARACTER SET = utf8;
|
|
||||||
|
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table `APP_MANAGER`.`AP_APP_CATEGORY`
|
-- Table AP_APP_CATEGORY
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_APP_CATEGORY`
|
CREATE TABLE IF NOT EXISTS AP_APP_CATEGORY(
|
||||||
(
|
ID INTEGER NOT NULL AUTO_INCREMENT,
|
||||||
`ID` INT(11) NOT NULL,
|
TENANT_ID INTEGER NOT NULL,
|
||||||
`CATEGORY` VARCHAR(45) NOT NULL,
|
CATEGORY VARCHAR(45) NOT NULL,
|
||||||
`CATEGORY_ICON` VARCHAR(45) NULL,
|
CATEGORY_ICON VARCHAR(45) NULL,
|
||||||
`TENANT_ID` INT(11) NULL,
|
PRIMARY KEY (ID)
|
||||||
PRIMARY KEY (`ID`)
|
);
|
||||||
)
|
|
||||||
ENGINE = InnoDB
|
|
||||||
DEFAULT CHARACTER SET = utf8;
|
|
||||||
|
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table `APP_MANAGER`.`AP_APP_TAG_MAPPING`
|
-- Table AP_APP_TAG_MAPPING
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_APP_TAG_MAPPING`
|
CREATE TABLE IF NOT EXISTS AP_APP_TAG_MAPPING(
|
||||||
(
|
ID INTEGER NOT NULL AUTO_INCREMENT,
|
||||||
`ID` INT(11) NOT NULL,
|
TENANT_ID INTEGER NOT NULL,
|
||||||
`TENANT_ID` INT(11) NOT NULL,
|
AP_APP_TAG_ID INTEGER NOT NULL,
|
||||||
`AP_APP_TAG_ID` INT(11) NOT NULL,
|
AP_APP_ID INTEGER NOT NULL,
|
||||||
`AP_APP_ID` INT(11) NOT NULL,
|
PRIMARY KEY (ID),
|
||||||
PRIMARY KEY (`ID`),
|
CONSTRAINT fk_AP_APP_TAG_copy1_AP_APP_TAG1
|
||||||
INDEX `fk_AP_APP_TAG_copy1_AP_APP_TAG1_idx` (`AP_APP_TAG_ID` ASC),
|
FOREIGN KEY (AP_APP_TAG_ID)
|
||||||
INDEX `fk_AP_APP_TAG_copy1_AP_APP1_idx` (`AP_APP_ID` ASC),
|
REFERENCES AP_APP_TAG (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
||||||
CONSTRAINT `fk_AP_APP_TAG_copy1_AP_APP_TAG1`
|
CONSTRAINT fk_AP_APP_TAG_copy1_AP_APP1
|
||||||
FOREIGN KEY (`AP_APP_TAG_ID`)
|
FOREIGN KEY (AP_APP_ID)
|
||||||
REFERENCES `APP_MANAGER`.`AP_APP_TAG` (`ID`)
|
REFERENCES AP_APP (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||||
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);
|
||||||
CONSTRAINT `fk_AP_APP_TAG_copy1_AP_APP1`
|
CREATE INDEX fk_AP_APP_TAG_copy1_AP_APP1_idx ON AP_APP_TAG_MAPPING (AP_APP_ID ASC);
|
||||||
FOREIGN KEY (`AP_APP_ID`)
|
|
||||||
REFERENCES `APP_MANAGER`.`AP_APP` (`ID`)
|
|
||||||
ON DELETE NO ACTION
|
|
||||||
ON UPDATE NO ACTION
|
|
||||||
)
|
|
||||||
ENGINE = InnoDB
|
|
||||||
DEFAULT CHARACTER SET = utf8;
|
|
||||||
|
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table `APP_MANAGER`.`AP_APP_CATEGORY_MAPPING`
|
-- Table AP_APP_CATEGORY_MAPPING
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_APP_CATEGORY_MAPPING`
|
CREATE TABLE IF NOT EXISTS AP_APP_CATEGORY_MAPPING(
|
||||||
(
|
ID INTEGER NOT NULL AUTO_INCREMENT,
|
||||||
`ID` INT(11) NOT NULL,
|
TENANT_ID INTEGER NOT NULL,
|
||||||
`TENANT_ID` INT(11) NOT NULL,
|
AP_APP_CATEGORY_ID INTEGER NOT NULL,
|
||||||
`AP_APP_CATEGORY_ID` INT(11) NOT NULL,
|
AP_APP_ID INTEGER NOT NULL,
|
||||||
`AP_APP_ID` INT(11) NOT NULL,
|
PRIMARY KEY (ID),
|
||||||
PRIMARY KEY (`ID`),
|
CONSTRAINT fk_AP_APP_CATEGORY_copy1_AP_APP_CATEGORY1
|
||||||
INDEX `fk_AP_APP_CATEGORY_copy1_AP_APP_CATEGORY1_idx` (`AP_APP_CATEGORY_ID` ASC),
|
FOREIGN KEY (AP_APP_CATEGORY_ID)
|
||||||
INDEX `fk_AP_APP_CATEGORY_copy1_AP_APP1_idx` (`AP_APP_ID` ASC),
|
REFERENCES AP_APP_CATEGORY (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
||||||
CONSTRAINT `fk_AP_APP_CATEGORY_copy1_AP_APP_CATEGORY1`
|
CONSTRAINT fk_AP_APP_CATEGORY_copy1_AP_APP1
|
||||||
FOREIGN KEY (`AP_APP_CATEGORY_ID`)
|
FOREIGN KEY (AP_APP_ID)
|
||||||
REFERENCES `APP_MANAGER`.`AP_APP_CATEGORY` (`ID`)
|
REFERENCES AP_APP (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||||
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);
|
||||||
CONSTRAINT `fk_AP_APP_CATEGORY_copy1_AP_APP1`
|
CREATE INDEX fk_AP_APP_CATEGORY_copy1_AP_APP1_idx ON AP_APP_CATEGORY_MAPPING (AP_APP_ID ASC);
|
||||||
FOREIGN KEY (`AP_APP_ID`)
|
|
||||||
REFERENCES `APP_MANAGER`.`AP_APP` (`ID`)
|
|
||||||
ON DELETE NO ACTION
|
|
||||||
ON UPDATE NO ACTION
|
|
||||||
)
|
|
||||||
ENGINE = InnoDB
|
|
||||||
DEFAULT CHARACTER SET = utf8;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_APP_OP_DEVICE_MAPPING` (
|
-- -----------------------------------------------------
|
||||||
`ID` INT(11) NOT NULL AUTO_INCREMENT,
|
-- Table AP_APP_SUB_OP_MAPPING
|
||||||
`TENANT_ID` INT(11) NOT NULL,
|
-- -----------------------------------------------------
|
||||||
`OPERATION_ID` INT(11) NOT NULL,
|
CREATE TABLE IF NOT EXISTS AP_APP_SUB_OP_MAPPING (
|
||||||
`AP_DEVICE_SUBSCRIPTION_ID` INT(11) NOT NULL,
|
ID INTEGER NOT NULL AUTO_INCREMENT,
|
||||||
PRIMARY KEY (`ID`),
|
TENANT_ID INTEGER NOT NULL,
|
||||||
INDEX `fk_AP_APP_OP_DEVICE_MAPPING_AP_DEVICE_SUBSCRIPTION1_idx` (`AP_DEVICE_SUBSCRIPTION_ID` ASC),
|
OPERATION_ID INTEGER NOT NULL,
|
||||||
CONSTRAINT `fk_AP_APP_OP_DEVICE_MAPPING_AP_DEVICE_SUBSCRIPTION1`
|
AP_DEVICE_SUBSCRIPTION_ID INTEGER NOT NULL,
|
||||||
FOREIGN KEY (`AP_DEVICE_SUBSCRIPTION_ID`)
|
PRIMARY KEY (ID),
|
||||||
REFERENCES `APP_MANAGER`.`AP_DEVICE_SUBSCRIPTION` (`ID`)
|
CONSTRAINT fk_AP_APP_SUB_OP_MAPPING_AP_DEVICE_SUBSCRIPTION1
|
||||||
ON DELETE NO ACTION
|
FOREIGN KEY (AP_DEVICE_SUBSCRIPTION_ID)
|
||||||
ON UPDATE NO ACTION)
|
REFERENCES AP_DEVICE_SUBSCRIPTION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||||
ENGINE = InnoDB
|
);
|
||||||
DEFAULT CHARACTER SET = utf8;
|
CREATE INDEX fk_AP_APP_SUB_OP_MAPPING_AP_DEVICE_SUBSCRIPTION1_idx ON AP_APP_SUB_OP_MAPPING (AP_DEVICE_SUBSCRIPTION_ID ASC);
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table `APP_MANAGER`.`AP_SCHEDULED_SUBSCRIPTION`
|
-- Table AP_SCHEDULED_SUBSCRIPTION
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS `APP_MANAGER`.`AP_SCHEDULED_SUBSCRIPTION`(
|
CREATE TABLE IF NOT EXISTS AP_SCHEDULED_SUBSCRIPTION(
|
||||||
`ID` INT NOT NULL AUTO_INCREMENT,
|
ID INTEGER NOT NULL AUTO_INCREMENT,
|
||||||
`TASK_NAME` VARCHAR(100) NOT NULL,
|
TASK_NAME VARCHAR(100) NOT NULL,
|
||||||
`APPLICATION_UUID` VARCHAR(36) NOT NULL,
|
APPLICATION_UUID VARCHAR(36) NOT NULL,
|
||||||
`SUBSCRIBER_LIST` TEXT NOT NULL,
|
SUBSCRIBER_LIST LONGVARCHAR NOT NULL,
|
||||||
`STATUS` VARCHAR(15) NOT NULL,
|
STATUS VARCHAR(15) NOT NULL,
|
||||||
`SCHEDULED_AT` TIMESTAMP NOT NULL,
|
SCHEDULED_AT TIMESTAMP NOT NULL,
|
||||||
`SCHEDULED_BY` VARCHAR(100) NOT NULL,
|
SCHEDULED_BY VARCHAR(100) NOT NULL,
|
||||||
`SCHEDULED_TIMESTAMP` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
SCHEDULED_TIMESTAMP TIMESTAMP NOT NULL,
|
||||||
`DELETED` BOOLEAN NOT NULL DEFAULT FALSE,
|
DELETED BOOLEAN,
|
||||||
PRIMARY KEY (`ID`),
|
PRIMARY KEY (ID),
|
||||||
CONSTRAINT `fk_AP_SCHEDULED_SUBSCRIPTION_AP_APP_RELEASE`
|
CONSTRAINT fk_AP_SCHEDULED_SUBSCRIPTION_AP_APP_RELEASE
|
||||||
FOREIGN KEY (`APPLICATION_UUID`)
|
FOREIGN KEY (APPLICATION_UUID)
|
||||||
REFERENCES `AP_APP_RELEASE` (`UUID`) ON DELETE NO ACTION ON UPDATE NO ACTION
|
REFERENCES AP_APP_RELEASE (UUID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||||
)
|
);
|
||||||
ENGINE = InnoDB
|
|
||||||
DEFAULT CHARACTER SET = utf8;
|
|
||||||
|
Loading…
Reference in new issue