|
|
|
@ -36,7 +36,7 @@ FOREIGN KEY(PLATFORM_ID) REFERENCES APPM_PLATFORM(ID) ON DELETE CASCADE,
|
|
|
|
|
PRIMARY KEY (ID, TENANT_ID, PLATFORM_ID)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX FK_PLATFROM_TENANT_MAPPING_PLATFORM ON APPM_PLATFORM_TENANT_MAPPING(PLATFORM_ID ASC);
|
|
|
|
|
CREATE INDEX IF NOT EXISTS FK_PLATFROM_TENANT_MAPPING_PLATFORM ON APPM_PLATFORM_TENANT_MAPPING(PLATFORM_ID ASC);
|
|
|
|
|
|
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
|
-- Table APPM_APPLICATION_CATEGORY
|
|
|
|
@ -48,61 +48,118 @@ CREATE TABLE IF NOT EXISTS APPM_APPLICATION_CATEGORY (
|
|
|
|
|
PUBLISHED TINYINT NULL,
|
|
|
|
|
PRIMARY KEY (ID));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
INSERT INTO APPM_APPLICATION_CATEGORY (NAME, DESCRIPTION, PUBLISHED) VALUES ('Enterprise', 'Enterprise level
|
|
|
|
|
applications which the artifacts need to be provided', 1);
|
|
|
|
|
INSERT INTO APPM_APPLICATION_CATEGORY (NAME, DESCRIPTION, PUBLISHED) VALUES ('Public', 'Public category in which the
|
|
|
|
|
application need to be downloaded from the public application store', 1);
|
|
|
|
|
|
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
|
-- Table `APPM_LIFECYCLE_STATE`
|
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
|
CREATE TABLE IF NOT EXISTS APPM_LIFECYCLE_STATE (
|
|
|
|
|
ID INT NOT NULL AUTO_INCREMENT,
|
|
|
|
|
ID INT NOT NULL AUTO_INCREMENT UNIQUE,
|
|
|
|
|
NAME VARCHAR(100) NOT NULL,
|
|
|
|
|
IDENTIFIER VARCHAR(100) NOT NULL,
|
|
|
|
|
DESCRIPTION TEXT NULL,
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
UNIQUE INDEX APPM_LIFECYCLE_STATE_IDENTIFIER_UNIQUE (IDENTIFIER ASC));
|
|
|
|
|
|
|
|
|
|
INSERT INTO APPM_LIFECYCLE_STATE (NAME, IDENTIFIER, DESCRIPTION) VALUES ('CREATED', 'CREATED', 'Application creation
|
|
|
|
|
initial state');
|
|
|
|
|
INSERT INTO APPM_LIFECYCLE_STATE (NAME, IDENTIFIER, DESCRIPTION)
|
|
|
|
|
VALUES ('IN REVIEW', 'IN REFVIEW', 'Application is in in-review state');
|
|
|
|
|
INSERT INTO APPM_LIFECYCLE_STATE (NAME, IDENTIFIER, DESCRIPTION)
|
|
|
|
|
VALUES ('APPROVED', 'APPROVED', 'State in which Application is approved after reviewing.');
|
|
|
|
|
INSERT INTO APPM_LIFECYCLE_STATE (NAME, IDENTIFIER, DESCRIPTION)
|
|
|
|
|
VALUES ('REJECTED', 'REJECTED', 'State in which Application is rejected after reviewing.');
|
|
|
|
|
INSERT INTO APPM_LIFECYCLE_STATE (NAME, IDENTIFIER, DESCRIPTION)
|
|
|
|
|
VALUES ('PUBLISHED', 'PUBLISHED', 'State in which Application is in published state.');
|
|
|
|
|
INSERT INTO APPM_LIFECYCLE_STATE (NAME, IDENTIFIER, DESCRIPTION)
|
|
|
|
|
VALUES ('UNPUBLISHED', 'UNPUBLISHED', 'State in which Application is in un published state.');
|
|
|
|
|
INSERT INTO APPM_LIFECYCLE_STATE (NAME, IDENTIFIER, DESCRIPTION)
|
|
|
|
|
VALUES ('RETIRED', 'RETIRED', 'Retiring an application to indicate end of life state,');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS APPM_LIFECYCLE_STATE_TRANSITION
|
|
|
|
|
(
|
|
|
|
|
ID INT NOT NULL AUTO_INCREMENT UNIQUE,
|
|
|
|
|
INITIAL_STATE INT,
|
|
|
|
|
NEXT_STATE INT,
|
|
|
|
|
PERMISSION VARCHAR(1024),
|
|
|
|
|
DESCRIPTION VARCHAR(2048),
|
|
|
|
|
PRIMARY KEY (INITIAL_STATE, NEXT_STATE),
|
|
|
|
|
FOREIGN KEY (INITIAL_STATE) REFERENCES APPM_LIFECYCLE_STATE(ID) ON DELETE CASCADE,
|
|
|
|
|
FOREIGN KEY (NEXT_STATE) REFERENCES APPM_LIFECYCLE_STATE(ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
INSERT INTO APPM_LIFECYCLE_STATE_TRANSITION(INITIAL_STATE, NEXT_STATE, PERMISSION, DESCRIPTION) VALUES
|
|
|
|
|
(1, 2, null, 'Submit for review');
|
|
|
|
|
INSERT INTO APPM_LIFECYCLE_STATE_TRANSITION(INITIAL_STATE, NEXT_STATE, PERMISSION, DESCRIPTION) VALUES
|
|
|
|
|
(2, 1, null, 'Revoke from review');
|
|
|
|
|
INSERT INTO APPM_LIFECYCLE_STATE_TRANSITION(INITIAL_STATE, NEXT_STATE, PERMISSION, DESCRIPTION) VALUES
|
|
|
|
|
(2, 3, '/permission/admin/manage/device-mgt/application/review', 'APPROVE');
|
|
|
|
|
INSERT INTO APPM_LIFECYCLE_STATE_TRANSITION(INITIAL_STATE, NEXT_STATE, PERMISSION, DESCRIPTION) VALUES
|
|
|
|
|
(2, 4, '/permission/admin/manage/device-mgt/application/review', 'REJECT');
|
|
|
|
|
INSERT INTO APPM_LIFECYCLE_STATE_TRANSITION(INITIAL_STATE, NEXT_STATE, PERMISSION, DESCRIPTION) VALUES
|
|
|
|
|
(3, 4, '/permission/admin/manage/device-mgt/application/review', 'REJECT');
|
|
|
|
|
INSERT INTO APPM_LIFECYCLE_STATE_TRANSITION(INITIAL_STATE, NEXT_STATE, PERMISSION, DESCRIPTION) VALUES
|
|
|
|
|
(3, 5, null, 'PUBLISH');
|
|
|
|
|
INSERT INTO APPM_LIFECYCLE_STATE_TRANSITION(INITIAL_STATE, NEXT_STATE, PERMISSION, DESCRIPTION) VALUES
|
|
|
|
|
(5, 6, null, 'UN PUBLISH');
|
|
|
|
|
INSERT INTO APPM_LIFECYCLE_STATE_TRANSITION(INITIAL_STATE, NEXT_STATE, PERMISSION, DESCRIPTION) VALUES
|
|
|
|
|
(6, 5, null, 'PUBLISH');
|
|
|
|
|
INSERT INTO APPM_LIFECYCLE_STATE_TRANSITION(INITIAL_STATE, NEXT_STATE, PERMISSION, DESCRIPTION) VALUES
|
|
|
|
|
(4, 1, null, 'Return to CREATE STATE');
|
|
|
|
|
INSERT INTO APPM_LIFECYCLE_STATE_TRANSITION(INITIAL_STATE, NEXT_STATE, PERMISSION, DESCRIPTION) VALUES
|
|
|
|
|
(6, 1, null, 'Return to CREATE STATE');
|
|
|
|
|
INSERT INTO APPM_LIFECYCLE_STATE_TRANSITION(INITIAL_STATE, NEXT_STATE, PERMISSION, DESCRIPTION) VALUES
|
|
|
|
|
(6, 7, null, 'Retire');
|
|
|
|
|
|
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
|
-- Table APPM_APPLICATION
|
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
|
CREATE TABLE IF NOT EXISTS APPM_APPLICATION (
|
|
|
|
|
ID INT NOT NULL AUTO_INCREMENT,
|
|
|
|
|
UUID VARCHAR(100) NOT NULL,
|
|
|
|
|
NAME VARCHAR(100) NOT NULL,
|
|
|
|
|
SHORT_DESCRIPTION VARCHAR(255) NULL,
|
|
|
|
|
DESCRIPTION TEXT NULL,
|
|
|
|
|
ICON_NAME VARCHAR(100) NULL,
|
|
|
|
|
BANNER_NAME VARCHAR(100) NULL,
|
|
|
|
|
VIDEO_NAME VARCHAR(100) NULL,
|
|
|
|
|
SCREENSHOTS TEXT NULL,
|
|
|
|
|
CREATED_BY VARCHAR(255) NULL,
|
|
|
|
|
CREATED_AT DATETIME NOT NULL,
|
|
|
|
|
MODIFIED_AT DATETIME NULL,
|
|
|
|
|
APPLICATION_CATEGORY_ID INT NOT NULL,
|
|
|
|
|
PLATFORM_APPLICATION_MAPPING_ID INT NOT NULL,
|
|
|
|
|
APPM_LIFECYCLE_STATE_ID INT NOT NULL,
|
|
|
|
|
LIECYCLE_STATE_MODIFIED_BY VARCHAR(255) NULL,
|
|
|
|
|
LIFECYCLE_STATE_MODIFIED_AT DATETIME NULL,
|
|
|
|
|
PRIMARY KEY (ID, APPLICATION_CATEGORY_ID, PLATFORM_APPLICATION_MAPPING_ID, APPM_LIFECYCLE_STATE_ID),
|
|
|
|
|
UNIQUE INDEX UUID_UNIQUE (UUID ASC),
|
|
|
|
|
CONSTRAINT FK_APPLICATION_APPLICATION_CATEGORY
|
|
|
|
|
FOREIGN KEY (APPLICATION_CATEGORY_ID)
|
|
|
|
|
REFERENCES APPM_APPLICATION_CATEGORY (ID)
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `APPM_APPLICATION` (
|
|
|
|
|
`ID` INT NOT NULL AUTO_INCREMENT,
|
|
|
|
|
`UUID` VARCHAR(100) NOT NULL,
|
|
|
|
|
`IDENTIFIER` VARCHAR(255) NULL,
|
|
|
|
|
`NAME` VARCHAR(100) NOT NULL,
|
|
|
|
|
`SHORT_DESCRIPTION` VARCHAR(255) NULL,
|
|
|
|
|
`DESCRIPTION` TEXT NULL,
|
|
|
|
|
`ICON_NAME` VARCHAR(100) NULL,
|
|
|
|
|
`BANNER_NAME` VARCHAR(100) NULL,
|
|
|
|
|
`VIDEO_NAME` VARCHAR(100) NULL,
|
|
|
|
|
`SCREENSHOTS` TEXT NULL,
|
|
|
|
|
`CREATED_BY` VARCHAR(255) NULL,
|
|
|
|
|
`CREATED_AT` DATETIME NOT NULL,
|
|
|
|
|
`MODIFIED_AT` DATETIME NULL,
|
|
|
|
|
`IS_FREE` TINYINT(1) NULL,
|
|
|
|
|
`PAYMENT_CURRENCY` VARCHAR(45) NULL,
|
|
|
|
|
`PAYMENT_PRICE` DECIMAL(10,2) NULL,
|
|
|
|
|
`APPLICATION_CATEGORY_ID` INT NOT NULL,
|
|
|
|
|
`LIFECYCLE_STATE_ID` INT NOT NULL,
|
|
|
|
|
`LIFECYCLE_STATE_MODIFIED_BY` VARCHAR(255) NULL,
|
|
|
|
|
`LIFECYCLE_STATE_MODIFIED_AT` DATETIME NULL,
|
|
|
|
|
`TENANT_ID` INT NULL,
|
|
|
|
|
`PLATFORM_ID` INT NOT NULL,
|
|
|
|
|
PRIMARY KEY (`ID`, `APPLICATION_CATEGORY_ID`, `LIFECYCLE_STATE_ID`, `PLATFORM_ID`),
|
|
|
|
|
UNIQUE INDEX `UUID_UNIQUE` (`UUID` ASC),
|
|
|
|
|
FOREIGN KEY (`APPLICATION_CATEGORY_ID`)
|
|
|
|
|
REFERENCES `APPM_APPLICATION_CATEGORY` (`ID`)
|
|
|
|
|
ON DELETE NO ACTION
|
|
|
|
|
ON UPDATE NO ACTION,
|
|
|
|
|
CONSTRAINT fk_APPM_APPLICATION_APPM_PLATFORM_TENANT_MAPPING1
|
|
|
|
|
FOREIGN KEY (PLATFORM_APPLICATION_MAPPING_ID)
|
|
|
|
|
REFERENCES APPM_PLATFORM_TENANT_MAPPING (ID)
|
|
|
|
|
CONSTRAINT `fk_APPM_APPLICATION_APPM_LIFECYCLE_STATE1`
|
|
|
|
|
FOREIGN KEY (`LIFECYCLE_STATE_ID`)
|
|
|
|
|
REFERENCES `APPM_LIFECYCLE_STATE` (`ID`)
|
|
|
|
|
ON DELETE NO ACTION
|
|
|
|
|
ON UPDATE NO ACTION,
|
|
|
|
|
CONSTRAINT fk_APPM_APPLICATION_APPM_LIFECYCLE_STATE1
|
|
|
|
|
FOREIGN KEY (APPM_LIFECYCLE_STATE_ID)
|
|
|
|
|
REFERENCES APPM_LIFECYCLE_STATE (ID)
|
|
|
|
|
CONSTRAINT `fk_APPM_APPLICATION_APPM_PLATFORM1`
|
|
|
|
|
FOREIGN KEY (`PLATFORM_ID`)
|
|
|
|
|
REFERENCES `APPM_PLATFORM` (`ID`)
|
|
|
|
|
ON DELETE NO ACTION
|
|
|
|
|
ON UPDATE NO ACTION);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX FK_APPLICATION_APPLICATION_CATEGORY ON APPM_APPLICATION(APPLICATION_CATEGORY_ID ASC);
|
|
|
|
|
CREATE INDEX FK_APPLICATION_PLATFORM_APPLICATION_MAPPING ON APPM_APPLICATION(PLATFORM_APPLICATION_MAPPING_ID ASC);
|
|
|
|
|
CREATE INDEX IF NOT EXISTS FK_APPLICATION_APPLICATION_CATEGORY ON APPM_APPLICATION(APPLICATION_CATEGORY_ID ASC);
|
|
|
|
|
|
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
|
-- Table APPM_APPLICATION_PROPERTY
|
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
|