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
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS AP_APP (
|
||||
ID INT(11) NOT NULL AUTO_INCREMENT,
|
||||
NAME VARCHAR(45) NOT NULL,
|
||||
TYPE VARCHAR(200) NOT NULL,
|
||||
TENANT_ID VARCHAR(45) NOT NULL,
|
||||
APP_CATEGORY VARCHAR(45) NULL DEFAULT NULL,
|
||||
RESTRICTED INT(11) NOT NULL,
|
||||
STATUS VARCHAR(45) NOT NULL DEFAULT 'ACTIVE',
|
||||
SUB_TYPE VARCHAR(45) NOT NULL,
|
||||
CURRENCY VARCHAR(45) NULL DEFAULT '$',
|
||||
DEVICE_TYPE_ID INT(11) NOT NULL,
|
||||
PRIMARY KEY (ID));
|
||||
CREATE TABLE IF NOT EXISTS APP_MANAGER.AP_APP(
|
||||
ID int NOT NULL AUTO_INCREMENT,
|
||||
NAME varchar(45) NOT NULL,
|
||||
DESCRIPTION clob NULL,
|
||||
TYPE varchar(200) NOT NULL,
|
||||
TENANT_ID varchar(45) NOT NULL,
|
||||
STATUS varchar(45) NOT NULL DEFAULT 'ACTIVE',
|
||||
SUB_TYPE varchar(45) NOT NULL,
|
||||
CURRENCY varchar(45) NULL DEFAULT '$',
|
||||
RATING int NULL,
|
||||
DEVICE_TYPE_ID int NOT NULL,
|
||||
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
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS AP_APP_RELEASE (
|
||||
ID INT(11) NOT NULL AUTO_INCREMENT,
|
||||
VERSION VARCHAR(25) 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,
|
||||
STORED_LOCATION VARCHAR(100) NOT NULL,
|
||||
BANNER_LOCATION VARCHAR(100) NOT NULL,
|
||||
ICON_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,
|
||||
APP_HASH_VALUE VARCHAR(100) NOT NULL,
|
||||
SHARED_WITH_ALL_TENANTS INT(11) NULL DEFAULT NULL,
|
||||
APP_META_INFO VARCHAR(20000) NULL DEFAULT NULL,
|
||||
RATING DOUBLE NULL DEFAULT NULL,
|
||||
RATED_USERS INT(11) NULL,
|
||||
AP_APP_ID INT(11) NOT NULL,
|
||||
PRIMARY KEY (ID, AP_APP_ID),
|
||||
CREATE TABLE IF NOT EXISTS APP_MANAGER.AP_APP_RELEASE(
|
||||
ID int 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,
|
||||
APP_PRICE decimal(6, 2) 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 NULL DEFAULT NULL,
|
||||
APP_META_INFO clob NULL DEFAULT NULL,
|
||||
PACKAGE_NAME varchar(45) NOT NULL,
|
||||
SUPPORTED_OS_VERSIONS varchar(45) NULL,
|
||||
RATING double NULL DEFAULT NULL,
|
||||
CURRENT_STATE varchar(45) NULL,
|
||||
RATED_USERS int NULL,
|
||||
AP_APP_ID int NOT NULL,
|
||||
PRIMARY KEY (
|
||||
ID,
|
||||
AP_APP_ID
|
||||
),
|
||||
CONSTRAINT fk_AP_APP_RELEASE_AP_APP1
|
||||
FOREIGN KEY (AP_APP_ID)
|
||||
REFERENCES AP_APP (ID));
|
||||
|
||||
CREATE INDEX fk_AP_APP_RELEASE_AP_APP1_idx ON AP_APP_RELEASE (AP_APP_ID ASC);
|
||||
|
||||
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)
|
||||
)
|
||||
ENGINE InnoDB
|
||||
DEFAULT CHARACTER SET utf8
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table AP_APP_REVIEW
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS AP_APP_REVIEW (
|
||||
ID INT(11) NOT NULL AUTO_INCREMENT,
|
||||
TENANT_ID VARCHAR(45) NOT NULL,
|
||||
COMMENT VARCHAR(250) NOT NULL,
|
||||
PARENT_ID INT(11) NULL,
|
||||
CREATED_AT TIMESTAMP NOT NULL,
|
||||
MODIFIED_AT TIMESTAMP NOT NULL,
|
||||
RATING INT(11) NULL,
|
||||
USERNAME VARCHAR(45) NOT NULL,
|
||||
AP_APP_RELEASE_ID INT(11) NOT NULL,
|
||||
AP_APP_ID INT(11) NOT NULL,
|
||||
CREATE TABLE IF NOT EXISTS APP_MANAGER.AP_APP_REVIEW(
|
||||
ID int 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 DEFAULT current_timestamp(),
|
||||
MODIFIED_AT timestamp NOT NULL DEFAULT current_timestamp(),
|
||||
RATING int NULL,
|
||||
USERNAME varchar(45) NOT NULL,
|
||||
AP_APP_RELEASE_ID int NOT NULL,
|
||||
AP_APP_ID int 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));
|
||||
|
||||
CREATE INDEX fk_AP_APP_COMMENT_AP_APP_RELEASE1_idx ON AP_APP_REVIEW (AP_APP_RELEASE_ID ASC, AP_APP_ID ASC);
|
||||
|
||||
FOREIGN KEY (
|
||||
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_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
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS AP_APP_LIFECYCLE_STATE (
|
||||
ID INT(11) NOT NULL AUTO_INCREMENT,
|
||||
CURRENT_STATE VARCHAR(45) NOT NULL,
|
||||
PREVIOUS_STATE VARCHAR(45) NOT NULL,
|
||||
TENANT_ID VARCHAR(45) NOT NULL,
|
||||
UPDATED_BY VARCHAR(100) NOT NULL,
|
||||
UPDATED_AT TIMESTAMP NOT 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),
|
||||
CREATE TABLE IF NOT EXISTS APP_MANAGER.AP_APP_LIFECYCLE_STATE(
|
||||
ID int 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(),
|
||||
AP_APP_RELEASE_ID int NOT NULL,
|
||||
AP_APP_ID int NOT 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));
|
||||
|
||||
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);
|
||||
FOREIGN KEY (
|
||||
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_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
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS AP_APP_TAG (
|
||||
ID INT(11) NOT NULL AUTO_INCREMENT,
|
||||
TENANT_ID VARCHAR(45) NOT NULL,
|
||||
TAG VARCHAR(45) NOT NULL,
|
||||
AP_APP_ID INT(11) NOT NULL,
|
||||
PRIMARY KEY (ID),
|
||||
CONSTRAINT fk_AP_APP_TAGS_AP_APP1
|
||||
FOREIGN KEY (AP_APP_ID)
|
||||
REFERENCES AP_APP (ID));
|
||||
|
||||
CREATE INDEX fk_AP_APP_TAGS_AP_APP1_idx ON AP_APP_TAG (AP_APP_ID ASC);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS APP_MANAGER.AP_APP_TAG(
|
||||
ID int NOT NULL AUTO_INCREMENT,
|
||||
TENANT_ID varchar(45) NOT NULL,
|
||||
TAG varchar(45) NOT NULL,
|
||||
PRIMARY KEY (ID)
|
||||
)
|
||||
ENGINE InnoDB
|
||||
DEFAULT CHARACTER SET utf8
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table AP_DEVICE_SUBSCRIPTION
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS AP_DEVICE_SUBSCRIPTION (
|
||||
ID INT(11) 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_ENROLMENT_ID INT(11) NOT NULL,
|
||||
AP_APP_RELEASE_ID INT(11) NOT NULL,
|
||||
AP_APP_ID INT(11) NOT NULL,
|
||||
CREATE TABLE IF NOT EXISTS APP_MANAGER.AP_DEVICE_SUBSCRIPTION(
|
||||
ID int NOT NULL AUTO_INCREMENT,
|
||||
TENANT_ID varchar(45) NOT NULL,
|
||||
SUBSCRIBED_BY varchar(100) NOT NULL,
|
||||
SUBSCRIBED_TIMESTAMP timestamp NOT NULL DEFAULT current_timestamp(),
|
||||
UNSUBSCRIBED int NULL DEFAULT NULL,
|
||||
UNSUBSCRIBED_BY int NULL DEFAULT NULL,
|
||||
UNSUBSCRIBED_TIMESTAMP timestamp NULL DEFAULT NULL,
|
||||
SUBSCRIBED_FROM varchar(45) NULL,
|
||||
DM_DEVICE_ID int NOT NULL,
|
||||
AP_APP_RELEASE_ID int NOT NULL,
|
||||
AP_APP_ID int NOT NULL,
|
||||
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
|
||||
FOREIGN KEY (AP_APP_ID , AP_APP_RELEASE_ID)
|
||||
REFERENCES AP_APP_RELEASE (AP_APP_ID , ID));
|
||||
|
||||
CREATE INDEX fk_AP_DEVICE_SUBSCRIPTION_AP_APP_RELEASE1_idx ON AP_DEVICE_SUBSCRIPTION (AP_APP_ID ASC, AP_APP_RELEASE_ID ASC);
|
||||
FOREIGN KEY (
|
||||
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_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
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS AP_GROUP_SUBSCRIPTION (
|
||||
ID INT(11) 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,
|
||||
CREATE TABLE IF NOT EXISTS APP_MANAGER.AP_GROUP_SUBSCRIPTION(
|
||||
ID int NOT NULL AUTO_INCREMENT,
|
||||
TENANT_ID varchar(45) NOT NULL,
|
||||
SUBSCRIBED_BY varchar(100) NOT NULL,
|
||||
SUBSCRIBED_TIMESTAMP timestamp NOT NULL DEFAULT current_timestamp(),
|
||||
UNSUBSCRIBED int NULL DEFAULT NULL,
|
||||
UNSUBSCRIBED_BY int NULL DEFAULT NULL,
|
||||
UNSUBSCRIBED_TIMESTAMP timestamp NULL DEFAULT NULL,
|
||||
DM_GROUP_ID int NOT NULL,
|
||||
AP_APP_RELEASE_ID int NOT NULL,
|
||||
AP_APP_ID int NOT NULL,
|
||||
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
|
||||
FOREIGN KEY (AP_APP_RELEASE_ID , AP_APP_ID)
|
||||
REFERENCES 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);
|
||||
FOREIGN KEY (
|
||||
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_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
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS AP_ROLE_SUBSCRIPTION (
|
||||
ID INT(11) 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,
|
||||
CREATE TABLE IF NOT EXISTS APP_MANAGER.AP_ROLE_SUBSCRIPTION(
|
||||
ID int 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 DEFAULT current_timestamp(),
|
||||
UNSUBSCRIBED int NULL DEFAULT NULL,
|
||||
UNSUBSCRIBED_BY int NULL DEFAULT NULL,
|
||||
UNSUBSCRIBED_TIMESTAMP timestamp NULL DEFAULT NULL,
|
||||
AP_APP_RELEASE_ID int NOT NULL,
|
||||
AP_APP_ID int 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));
|
||||
|
||||
CREATE INDEX fk_AP_ROLE_SUBSCRIPTION_AP_APP_RELEASE1_idx ON AP_ROLE_SUBSCRIPTION (AP_APP_RELEASE_ID ASC, AP_APP_ID ASC);
|
||||
FOREIGN KEY (
|
||||
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_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
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS AP_UNRESTRICTED_ROLE (
|
||||
ID INT(11) NOT NULL AUTO_INCREMENT,
|
||||
TENANT_ID VARCHAR(45) NOT NULL,
|
||||
ROLE VARCHAR(45) NOT NULL,
|
||||
AP_APP_ID INT(11) NOT NULL,
|
||||
CREATE TABLE IF NOT EXISTS APP_MANAGER.AP_UNRESTRICTED_ROLE(
|
||||
ID int NOT NULL AUTO_INCREMENT,
|
||||
TENANT_ID varchar(45) NOT NULL,
|
||||
ROLE varchar(45) NOT NULL,
|
||||
AP_APP_ID int NOT NULL,
|
||||
PRIMARY KEY (ID),
|
||||
CONSTRAINT fk_AP_APP_VISIBILITY_AP_APP1
|
||||
FOREIGN KEY (AP_APP_ID)
|
||||
REFERENCES AP_APP (ID));
|
||||
|
||||
CREATE INDEX fk_AP_APP_VISIBILITY_AP_APP1_idx ON AP_UNRESTRICTED_ROLE (AP_APP_ID ASC);
|
||||
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)
|
||||
)
|
||||
ENGINE InnoDB
|
||||
DEFAULT CHARACTER SET utf8
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table AP_USER_SUBSCRIPTION
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS AP_USER_SUBSCRIPTION (
|
||||
ID INT(11) 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 DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
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,
|
||||
CREATE TABLE IF NOT EXISTS APP_MANAGER.AP_USER_SUBSCRIPTION(
|
||||
ID int 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 DEFAULT current_timestamp(),
|
||||
UNSUBSCRIBED int NULL DEFAULT NULL,
|
||||
UNSUBSCRIBED_BY int NULL DEFAULT NULL,
|
||||
UNSUBSCRIBED_TIMESTAMP timestamp NULL DEFAULT NULL,
|
||||
AP_APP_RELEASE_ID int NOT NULL,
|
||||
AP_APP_ID int 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 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