forked from community/device-mgt-core
parent
6e25a0bc3e
commit
5717e81cfb
@ -1,208 +1,355 @@
|
|||||||
|
CREATE SCHEMA IF NOT EXISTS APP_MANAGER
|
||||||
|
SET CATALOG APP_MANAGER
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table AP_APP
|
-- Table AP_APP
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS AP_APP (
|
CREATE TABLE IF NOT EXISTS APP_MANAGER.AP_APP(
|
||||||
ID INT(11) NOT NULL AUTO_INCREMENT,
|
ID int NOT NULL AUTO_INCREMENT,
|
||||||
NAME VARCHAR(45) NOT NULL,
|
NAME varchar(45) NOT NULL,
|
||||||
TYPE VARCHAR(200) NOT NULL,
|
DESCRIPTION clob NULL,
|
||||||
TENANT_ID VARCHAR(45) NOT NULL,
|
TYPE varchar(200) NOT NULL,
|
||||||
APP_CATEGORY VARCHAR(45) NULL DEFAULT NULL,
|
TENANT_ID varchar(45) NOT NULL,
|
||||||
RESTRICTED 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 int NULL,
|
||||||
DEVICE_TYPE_ID INT(11) NOT NULL,
|
DEVICE_TYPE_ID int NOT NULL,
|
||||||
PRIMARY KEY (ID));
|
PRIMARY KEY (ID),
|
||||||
|
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,
|
||||||
|
INDEX fk_AP_APP_DM_DEVICE_TYPE1_idx (DEVICE_TYPE_ID ASC)
|
||||||
|
)
|
||||||
|
ENGINE InnoDB
|
||||||
|
DEFAULT CHARACTER SET utf8
|
||||||
|
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table AP_APP_RELEASE
|
-- Table 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,
|
ID int NOT NULL AUTO_INCREMENT,
|
||||||
VERSION VARCHAR(25) NOT NULL,
|
DESCRIPTION clob NOT NULL,
|
||||||
TENANT_ID VARCHAR(45) NOT NULL,
|
VERSION varchar(10) NOT NULL,
|
||||||
UUID VARCHAR(200) NOT NULL,
|
TENANT_ID varchar(45) NOT NULL,
|
||||||
RELEASE_TYPE VARCHAR(45) NOT NULL,
|
UUID varchar(200) NOT NULL,
|
||||||
PACKAGE_NAME VARCHAR(45) NOT NULL,
|
RELEASE_TYPE varchar(45) NOT NULL,
|
||||||
APP_PRICE DECIMAL(6,2) NULL DEFAULT NULL,
|
APP_PRICE decimal(6, 2) NULL DEFAULT NULL,
|
||||||
STORED_LOCATION VARCHAR(100) NOT NULL,
|
STORED_LOCATION varchar(45) NOT NULL,
|
||||||
BANNER_LOCATION VARCHAR(100) NOT NULL,
|
BANNER_LOCATION varchar(45) NOT NULL,
|
||||||
ICON_LOCATION VARCHAR(100) NOT NULL,
|
SC_1_LOCATION varchar(45) NOT NULL,
|
||||||
SC_1_LOCATION VARCHAR(100) NOT NULL,
|
SC_2_LOCATION varchar(45) NULL DEFAULT NULL,
|
||||||
SC_2_LOCATION VARCHAR(100) NULL DEFAULT NULL,
|
SC_3_LOCATION varchar(45) NULL DEFAULT NULL,
|
||||||
SC_3_LOCATION VARCHAR(100) NULL DEFAULT NULL,
|
APP_HASH_VALUE varchar(1000) NOT NULL,
|
||||||
APP_HASH_VALUE VARCHAR(100) NOT NULL,
|
SHARED_WITH_ALL_TENANTS tinyint NULL DEFAULT NULL,
|
||||||
SHARED_WITH_ALL_TENANTS INT(11) NULL DEFAULT NULL,
|
APP_META_INFO clob NULL DEFAULT NULL,
|
||||||
APP_META_INFO VARCHAR(20000) NULL DEFAULT NULL,
|
PACKAGE_NAME varchar(45) NOT NULL,
|
||||||
RATING DOUBLE NULL DEFAULT NULL,
|
SUPPORTED_OS_VERSIONS varchar(45) NULL,
|
||||||
RATED_USERS INT(11) NULL,
|
RATING double NULL DEFAULT NULL,
|
||||||
AP_APP_ID INT(11) NOT NULL,
|
CURRENT_STATE varchar(45) NULL,
|
||||||
PRIMARY KEY (ID, AP_APP_ID),
|
RATED_USERS int NULL,
|
||||||
|
AP_APP_ID int NOT NULL,
|
||||||
|
PRIMARY KEY (
|
||||||
|
ID,
|
||||||
|
AP_APP_ID
|
||||||
|
),
|
||||||
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));
|
REFERENCES APP_MANAGER.AP_APP (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
||||||
|
INDEX fk_AP_APP_RELEASE_AP_APP1_idx (AP_APP_ID ASC)
|
||||||
CREATE INDEX fk_AP_APP_RELEASE_AP_APP1_idx ON AP_APP_RELEASE (AP_APP_ID ASC);
|
)
|
||||||
|
ENGINE InnoDB
|
||||||
|
DEFAULT CHARACTER SET utf8
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table AP_APP_REVIEW
|
-- Table 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,
|
ID int NOT NULL AUTO_INCREMENT,
|
||||||
TENANT_ID VARCHAR(45) NOT NULL,
|
TENANT_ID varchar(45) NOT NULL,
|
||||||
COMMENT VARCHAR(250) NOT NULL,
|
COMMENT varchar(250) NOT NULL,
|
||||||
PARENT_ID INT(11) NULL,
|
REPLY_COMMENT varchar(250) 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(),
|
||||||
RATING INT(11) NULL,
|
RATING int NULL,
|
||||||
USERNAME VARCHAR(45) NOT NULL,
|
USERNAME varchar(45) NOT NULL,
|
||||||
AP_APP_RELEASE_ID INT(11) NOT NULL,
|
AP_APP_RELEASE_ID int NOT NULL,
|
||||||
AP_APP_ID INT(11) NOT NULL,
|
AP_APP_ID int NOT NULL,
|
||||||
PRIMARY KEY (ID),
|
PRIMARY KEY (ID),
|
||||||
CONSTRAINT fk_AP_APP_COMMENT_AP_APP_RELEASE1
|
CONSTRAINT fk_AP_APP_COMMENT_AP_APP_RELEASE1
|
||||||
FOREIGN KEY (AP_APP_RELEASE_ID , AP_APP_ID)
|
FOREIGN KEY (
|
||||||
REFERENCES AP_APP_RELEASE (ID , AP_APP_ID));
|
AP_APP_RELEASE_ID,
|
||||||
|
AP_APP_ID
|
||||||
CREATE INDEX fk_AP_APP_COMMENT_AP_APP_RELEASE1_idx ON AP_APP_REVIEW (AP_APP_RELEASE_ID ASC, AP_APP_ID ASC);
|
)
|
||||||
|
REFERENCES APP_MANAGER.AP_APP_RELEASE (
|
||||||
|
ID,
|
||||||
|
AP_APP_ID
|
||||||
|
) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
||||||
|
INDEX fk_AP_APP_COMMENT_AP_APP_RELEASE1_idx (
|
||||||
|
AP_APP_RELEASE_ID ASC,
|
||||||
|
AP_APP_ID ASC
|
||||||
|
)
|
||||||
|
)
|
||||||
|
ENGINE InnoDB
|
||||||
|
DEFAULT CHARACTER SET utf8
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table AP_APP_LIFECYCLE_STATE
|
-- Table 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,
|
ID int NOT NULL AUTO_INCREMENT,
|
||||||
CURRENT_STATE VARCHAR(45) NOT NULL,
|
CURRENT_STATE varchar(45) NOT NULL,
|
||||||
PREVIOUS_STATE VARCHAR(45) NOT NULL,
|
PREVIOUSE_STATE varchar(45) NOT NULL,
|
||||||
TENANT_ID VARCHAR(45) NOT NULL,
|
TENANT_ID varchar(45) 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(),
|
||||||
AP_APP_RELEASE_ID INT(11) NOT NULL,
|
AP_APP_RELEASE_ID int NOT NULL,
|
||||||
AP_APP_ID INT(11) NOT NULL,
|
AP_APP_ID int NOT NULL,
|
||||||
PRIMARY KEY (ID, AP_APP_RELEASE_ID, AP_APP_ID),
|
PRIMARY KEY (
|
||||||
|
ID,
|
||||||
|
AP_APP_RELEASE_ID,
|
||||||
|
AP_APP_ID
|
||||||
|
),
|
||||||
CONSTRAINT fk_AP_APP_LIFECYCLE_STATE_AP_APP_RELEASE1
|
CONSTRAINT fk_AP_APP_LIFECYCLE_STATE_AP_APP_RELEASE1
|
||||||
FOREIGN KEY (AP_APP_RELEASE_ID , AP_APP_ID)
|
FOREIGN KEY (
|
||||||
REFERENCES AP_APP_RELEASE (ID , AP_APP_ID));
|
AP_APP_RELEASE_ID,
|
||||||
|
AP_APP_ID
|
||||||
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);
|
)
|
||||||
|
REFERENCES APP_MANAGER.AP_APP_RELEASE (
|
||||||
|
ID,
|
||||||
|
AP_APP_ID
|
||||||
|
) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
||||||
|
INDEX fk_AP_APP_LIFECYCLE_STATE_AP_APP_RELEASE1_idx (
|
||||||
|
AP_APP_RELEASE_ID ASC,
|
||||||
|
AP_APP_ID ASC
|
||||||
|
)
|
||||||
|
)
|
||||||
|
ENGINE InnoDB
|
||||||
|
DEFAULT CHARACTER SET utf8
|
||||||
|
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table AP_APP_TAG
|
-- Table 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,
|
ID int NOT NULL AUTO_INCREMENT,
|
||||||
TENANT_ID VARCHAR(45) NOT NULL,
|
TENANT_ID varchar(45) NOT NULL,
|
||||||
TAG VARCHAR(45) NOT NULL,
|
TAG varchar(45) NOT NULL,
|
||||||
AP_APP_ID INT(11) NOT NULL,
|
PRIMARY KEY (ID)
|
||||||
PRIMARY KEY (ID),
|
)
|
||||||
CONSTRAINT fk_AP_APP_TAGS_AP_APP1
|
ENGINE InnoDB
|
||||||
FOREIGN KEY (AP_APP_ID)
|
DEFAULT CHARACTER SET utf8
|
||||||
REFERENCES AP_APP (ID));
|
|
||||||
|
|
||||||
CREATE INDEX fk_AP_APP_TAGS_AP_APP1_idx ON AP_APP_TAG (AP_APP_ID ASC);
|
|
||||||
|
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table AP_DEVICE_SUBSCRIPTION
|
-- Table AP_DEVICE_SUBSCRIPTION
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS AP_DEVICE_SUBSCRIPTION (
|
CREATE TABLE IF NOT EXISTS APP_MANAGER.AP_DEVICE_SUBSCRIPTION(
|
||||||
ID INT(11) NOT NULL AUTO_INCREMENT,
|
ID int NOT NULL AUTO_INCREMENT,
|
||||||
TENANT_ID VARCHAR(45) NOT NULL,
|
TENANT_ID varchar(45) 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(),
|
||||||
UNSUBSCRIBED INT(11) NULL DEFAULT NULL,
|
UNSUBSCRIBED int NULL DEFAULT NULL,
|
||||||
UNSUBSCRIBED_BY INT(11) NULL DEFAULT NULL,
|
UNSUBSCRIBED_BY int NULL DEFAULT NULL,
|
||||||
UNSUBSCRIBED_TIMESTAMP TIMESTAMP NULL DEFAULT NULL,
|
UNSUBSCRIBED_TIMESTAMP timestamp NULL DEFAULT NULL,
|
||||||
DM_ENROLMENT_ID INT(11) NOT NULL,
|
SUBSCRIBED_FROM varchar(45) NULL,
|
||||||
AP_APP_RELEASE_ID INT(11) NOT NULL,
|
DM_DEVICE_ID int NOT NULL,
|
||||||
AP_APP_ID INT(11) NOT NULL,
|
AP_APP_RELEASE_ID int NOT NULL,
|
||||||
|
AP_APP_ID int NOT NULL,
|
||||||
PRIMARY KEY (ID),
|
PRIMARY KEY (ID),
|
||||||
|
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
|
CONSTRAINT fk_AP_DEVICE_SUBSCRIPTION_AP_APP_RELEASE1
|
||||||
FOREIGN KEY (AP_APP_ID , AP_APP_RELEASE_ID)
|
FOREIGN KEY (
|
||||||
REFERENCES AP_APP_RELEASE (AP_APP_ID , ID));
|
AP_APP_RELEASE_ID,
|
||||||
|
AP_APP_ID
|
||||||
CREATE INDEX fk_AP_DEVICE_SUBSCRIPTION_AP_APP_RELEASE1_idx ON AP_DEVICE_SUBSCRIPTION (AP_APP_ID ASC, AP_APP_RELEASE_ID ASC);
|
)
|
||||||
|
REFERENCES APP_MANAGER.AP_APP_RELEASE (
|
||||||
|
ID,
|
||||||
|
AP_APP_ID
|
||||||
|
) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
||||||
|
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
|
||||||
|
)
|
||||||
|
)
|
||||||
|
ENGINE InnoDB
|
||||||
|
DEFAULT CHARACTER SET utf8
|
||||||
|
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table AP_GROUP_SUBSCRIPTION
|
-- Table AP_GROUP_SUBSCRIPTION
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS AP_GROUP_SUBSCRIPTION (
|
CREATE TABLE IF NOT EXISTS APP_MANAGER.AP_GROUP_SUBSCRIPTION(
|
||||||
ID INT(11) NOT NULL AUTO_INCREMENT,
|
ID int NOT NULL AUTO_INCREMENT,
|
||||||
TENANT_ID VARCHAR(45) NOT NULL,
|
TENANT_ID varchar(45) 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(),
|
||||||
UNSUBSCRIBED INT(11) NULL DEFAULT NULL,
|
UNSUBSCRIBED int NULL DEFAULT NULL,
|
||||||
UNSUBSCRIBED_BY INT(11) NULL DEFAULT NULL,
|
UNSUBSCRIBED_BY int NULL DEFAULT NULL,
|
||||||
UNSUBSCRIBED_TIMESTAMP TIMESTAMP NULL DEFAULT NULL,
|
UNSUBSCRIBED_TIMESTAMP timestamp NULL DEFAULT NULL,
|
||||||
DM_GROUP_ID INT(11) NOT NULL,
|
DM_GROUP_ID int NOT NULL,
|
||||||
AP_APP_RELEASE_ID INT(11) NOT NULL,
|
AP_APP_RELEASE_ID int NOT NULL,
|
||||||
AP_APP_ID INT(11) NOT NULL,
|
AP_APP_ID int NOT NULL,
|
||||||
PRIMARY KEY (ID),
|
PRIMARY KEY (ID),
|
||||||
|
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
|
CONSTRAINT fk_AP_GROUP_SUBSCRIPTION_AP_APP_RELEASE1
|
||||||
FOREIGN KEY (AP_APP_RELEASE_ID , AP_APP_ID)
|
FOREIGN KEY (
|
||||||
REFERENCES AP_APP_RELEASE (ID , AP_APP_ID));
|
AP_APP_RELEASE_ID,
|
||||||
|
AP_APP_ID
|
||||||
CREATE INDEX fk_AP_GROUP_SUBSCRIPTION_AP_APP_RELEASE1_idx ON AP_GROUP_SUBSCRIPTION (AP_APP_RELEASE_ID ASC, AP_APP_ID ASC);
|
)
|
||||||
|
REFERENCES APP_MANAGER.AP_APP_RELEASE (
|
||||||
|
ID,
|
||||||
|
AP_APP_ID
|
||||||
|
) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
||||||
|
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
|
||||||
|
)
|
||||||
|
)
|
||||||
|
ENGINE InnoDB
|
||||||
|
DEFAULT CHARACTER SET utf8
|
||||||
|
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table AP_ROLE_SUBSCRIPTION
|
-- Table 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,
|
ID int NOT NULL AUTO_INCREMENT,
|
||||||
TENANT_ID VARCHAR(45) NOT NULL,
|
TENANT_ID varchar(45) 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(),
|
||||||
UNSUBSCRIBED INT(11) NULL DEFAULT NULL,
|
UNSUBSCRIBED int NULL DEFAULT NULL,
|
||||||
UNSUBSCRIBED_BY INT(11) NULL DEFAULT NULL,
|
UNSUBSCRIBED_BY int NULL DEFAULT NULL,
|
||||||
UNSUBSCRIBED_TIMESTAMP TIMESTAMP NULL DEFAULT NULL,
|
UNSUBSCRIBED_TIMESTAMP timestamp NULL DEFAULT NULL,
|
||||||
AP_APP_RELEASE_ID INT(11) NOT NULL,
|
AP_APP_RELEASE_ID int NOT NULL,
|
||||||
AP_APP_ID INT(11) NOT NULL,
|
AP_APP_ID int NOT NULL,
|
||||||
PRIMARY KEY (ID),
|
PRIMARY KEY (ID),
|
||||||
CONSTRAINT fk_AP_ROLE_SUBSCRIPTION_AP_APP_RELEASE1
|
CONSTRAINT fk_AP_ROLE_SUBSCRIPTION_AP_APP_RELEASE1
|
||||||
FOREIGN KEY (AP_APP_RELEASE_ID , AP_APP_ID)
|
FOREIGN KEY (
|
||||||
REFERENCES AP_APP_RELEASE (ID , AP_APP_ID));
|
AP_APP_RELEASE_ID,
|
||||||
|
AP_APP_ID
|
||||||
CREATE INDEX fk_AP_ROLE_SUBSCRIPTION_AP_APP_RELEASE1_idx ON AP_ROLE_SUBSCRIPTION (AP_APP_RELEASE_ID ASC, AP_APP_ID ASC);
|
)
|
||||||
|
REFERENCES APP_MANAGER.AP_APP_RELEASE (
|
||||||
|
ID,
|
||||||
|
AP_APP_ID
|
||||||
|
) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
||||||
|
INDEX fk_AP_ROLE_SUBSCRIPTION_AP_APP_RELEASE1_idx (
|
||||||
|
AP_APP_RELEASE_ID ASC,
|
||||||
|
AP_APP_ID ASC
|
||||||
|
)
|
||||||
|
)
|
||||||
|
ENGINE InnoDB
|
||||||
|
DEFAULT CHARACTER SET utf8
|
||||||
|
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table AP_UNRESTRICTED_ROLE
|
-- Table 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,
|
ID int NOT NULL AUTO_INCREMENT,
|
||||||
TENANT_ID VARCHAR(45) NOT NULL,
|
TENANT_ID varchar(45) NOT NULL,
|
||||||
ROLE VARCHAR(45) NOT NULL,
|
ROLE varchar(45) NOT NULL,
|
||||||
AP_APP_ID INT(11) NOT NULL,
|
AP_APP_ID int NOT NULL,
|
||||||
PRIMARY KEY (ID),
|
PRIMARY KEY (ID),
|
||||||
CONSTRAINT fk_AP_APP_VISIBILITY_AP_APP1
|
CONSTRAINT fk_AP_APP_VISIBILITY_AP_APP1
|
||||||
FOREIGN KEY (AP_APP_ID)
|
FOREIGN KEY (AP_APP_ID)
|
||||||
REFERENCES AP_APP (ID));
|
REFERENCES APP_MANAGER.AP_APP (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
||||||
|
INDEX fk_AP_APP_VISIBILITY_AP_APP1_idx (AP_APP_ID ASC)
|
||||||
CREATE INDEX fk_AP_APP_VISIBILITY_AP_APP1_idx ON AP_UNRESTRICTED_ROLE (AP_APP_ID ASC);
|
)
|
||||||
|
ENGINE InnoDB
|
||||||
|
DEFAULT CHARACTER SET utf8
|
||||||
|
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table AP_USER_SUBSCRIPTION
|
-- Table 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,
|
ID int NOT NULL AUTO_INCREMENT,
|
||||||
TENANT_ID VARCHAR(45) NOT NULL,
|
TENANT_ID varchar(45) 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 DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
SUBSCRIBED_TIMESTAMP timestamp NOT NULL DEFAULT current_timestamp(),
|
||||||
UNSUBSCRIBED INT(11) NULL DEFAULT NULL,
|
UNSUBSCRIBED int NULL DEFAULT NULL,
|
||||||
UNSUBSCRIBED_BY INT(11) NULL DEFAULT NULL,
|
UNSUBSCRIBED_BY int NULL DEFAULT NULL,
|
||||||
UNSUBSCRIBED_TIMESTAMP TIMESTAMP NULL DEFAULT NULL,
|
UNSUBSCRIBED_TIMESTAMP timestamp NULL DEFAULT NULL,
|
||||||
AP_APP_RELEASE_ID INT(11) NOT NULL,
|
AP_APP_RELEASE_ID int NOT NULL,
|
||||||
AP_APP_ID INT(11) NOT NULL,
|
AP_APP_ID int NOT NULL,
|
||||||
PRIMARY KEY (ID),
|
PRIMARY KEY (ID),
|
||||||
CONSTRAINT fk_AP_USER_SUBSCRIPTION_AP_APP_RELEASE1
|
CONSTRAINT fk_AP_USER_SUBSCRIPTION_AP_APP_RELEASE1
|
||||||
FOREIGN KEY (AP_APP_RELEASE_ID , AP_APP_ID)
|
FOREIGN KEY (
|
||||||
REFERENCES AP_APP_RELEASE (ID , AP_APP_ID));
|
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,
|
||||||
|
INDEX fk_AP_USER_SUBSCRIPTION_AP_APP_RELEASE1_idx (
|
||||||
|
AP_APP_RELEASE_ID ASC,
|
||||||
|
AP_APP_ID ASC
|
||||||
|
)
|
||||||
|
)
|
||||||
|
ENGINE InnoDB
|
||||||
|
DEFAULT CHARACTER SET utf8
|
||||||
|
|
||||||
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 APP_MANAGER.AP_APP_CATEGORY(
|
||||||
|
ID int NOT NULL AUTO_INCREMENT,
|
||||||
|
TENANT_ID varchar(45) NOT NULL,
|
||||||
|
CATEGORY varchar(45) NOT NULL,
|
||||||
|
CATEGORY_ICON varchar(45) NULL,
|
||||||
|
PRIMARY KEY (ID)
|
||||||
|
)
|
||||||
|
ENGINE InnoDB
|
||||||
|
DEFAULT CHARACTER SET utf8
|
||||||
|
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
-- Table AP_APP_TAG_MAPPING
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
CREATE TABLE IF NOT EXISTS APP_MANAGER.AP_APP_TAG_MAPPING(
|
||||||
|
ID int NOT NULL AUTO_INCREMENT,
|
||||||
|
AP_APP_TAG_ID int NOT NULL,
|
||||||
|
AP_APP_ID int NOT NULL,
|
||||||
|
PRIMARY KEY (ID),
|
||||||
|
CONSTRAINT fk_AP_APP_TAG_copy1_AP_APP_TAG1
|
||||||
|
FOREIGN KEY (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 APP_MANAGER.AP_APP (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
||||||
|
INDEX fk_AP_APP_TAG_copy1_AP_APP_TAG1_idx (AP_APP_TAG_ID ASC),
|
||||||
|
INDEX fk_AP_APP_TAG_copy1_AP_APP1_idx (AP_APP_ID ASC)
|
||||||
|
)
|
||||||
|
ENGINE InnoDB
|
||||||
|
DEFAULT CHARACTER SET utf8
|
||||||
|
|
||||||
|
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
-- Table AP_APP_CATEGORY_MAPPING
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
CREATE TABLE IF NOT EXISTS APP_MANAGER.AP_APP_CATEGORY_MAPPING(
|
||||||
|
ID int NOT NULL AUTO_INCREMENT,
|
||||||
|
AP_APP_CATEGORY_ID int NOT NULL,
|
||||||
|
AP_APP_ID int NOT NULL,
|
||||||
|
PRIMARY KEY (ID),
|
||||||
|
CONSTRAINT fk_AP_APP_CATEGORY_copy1_AP_APP_CATEGORY1
|
||||||
|
FOREIGN KEY (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 APP_MANAGER.AP_APP (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
||||||
|
INDEX fk_AP_APP_CATEGORY_copy1_AP_APP_CATEGORY1_idx (AP_APP_CATEGORY_ID ASC),
|
||||||
|
INDEX fk_AP_APP_CATEGORY_copy1_AP_APP1_idx (AP_APP_ID ASC)
|
||||||
|
)
|
||||||
|
ENGINE InnoDB
|
||||||
|
DEFAULT CHARACTER SET utf8
|
||||||
|
Loading…
Reference in new issue