Committing the fixes for the database schema.

feature/appm-store/pbac
sinthuja 7 years ago
parent 2d4de10c6c
commit d0edbb8aa7

@ -7,6 +7,7 @@
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS APPM_PLATFORM (
ID INT NOT NULL AUTO_INCREMENT UNIQUE,
IDENTIFIER VARCHAR (100) NOT NULL,
TENANT_ID INT NOT NULL ,
NAME VARCHAR (255),
FILE_BASED BOOLEAN,
@ -14,9 +15,10 @@ DESCRIPTION LONGVARCHAR,
IS_SHARED BOOLEAN,
IS_DEFAULT_TENANT_MAPPING BOOLEAN,
ICON_NAME VARCHAR (100),
PRIMARY KEY (IDENTIFIER, TENANT_ID)
PRIMARY KEY (ID)
);
CREATE TABLE IF NOT EXISTS APPM_PLATFORM_PROPERTIES (
ID INT NOT NULL AUTO_INCREMENT,
PLATFORM_ID INT NOT NULL,
@ -120,7 +122,6 @@ INSERT INTO APPM_LIFECYCLE_STATE_TRANSITION(INITIAL_STATE, NEXT_STATE, PERMISSIO
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,
@ -319,16 +320,16 @@ CREATE TABLE IF NOT EXISTS APPM_VISIBILITY (
VALUE VARCHAR(255),
RESOURCE_TYPE_ID INT NOT NULL,
APPLICATION_ID INT NULL,
PRIMARY KEY (ID, RESOURCE_TYPE_ID),
PRIMARY KEY (ID),
CONSTRAINT fk_APPM_VISIBILITY_APPM_RESOURCE_TYPE1
FOREIGN KEY (RESOURCE_TYPE_ID)
REFERENCES APPM_RESOURCE_TYPE (ID)
ON DELETE CASCADE,
ON UPDATE CASCADE,
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT fk_APPM_VISIBILITY_APPM_APPLICATION1
FOREIGN KEY (APPLICATION_ID)
REFERENCES APPM_APPLICATION (ID)
ON DELETE CASCADE,
ON DELETE CASCADE
ON UPDATE CASCADE);
CREATE INDEX FK_APPM_VISIBILITY_RESOURCE_TYPE ON APPM_VISIBILITY(RESOURCE_TYPE_ID ASC);

@ -1,6 +1,7 @@
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 (
ID INT IDENTITY(1,1) NOT NULL UNIQUE,
IDENTIFIER VARCHAR (100) NOT NULL,
TENANT_ID INT NOT NULL ,
NAME VARCHAR (255),
FILE_BASED BIT,
@ -8,7 +9,7 @@ CREATE TABLE APPM_PLATFORM (
IS_SHARED BIT,
IS_DEFAULT_TENANT_MAPPING BIT,
ICON_NAME VARCHAR (100),
PRIMARY KEY (IDENTIFIER, TENANT_ID)
PRIMARY KEY (ID)
);
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[APPM_PLATFORM_PROPERTIES]') AND TYPE IN (N'U'))

@ -16,6 +16,7 @@ SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS APPM_PLATFORM (
ID INT NOT NULL AUTO_INCREMENT UNIQUE,
IDENTIFIER VARCHAR (100) NOT NULL,
TENANT_ID INT NOT NULL ,
NAME VARCHAR (255),
FILE_BASED BOOLEAN,
@ -23,7 +24,7 @@ DESCRIPTION VARCHAR (2048),
IS_SHARED BOOLEAN,
IS_DEFAULT_TENANT_MAPPING BOOLEAN,
ICON_NAME VARCHAR (100),
PRIMARY KEY (IDENTIFIER, TENANT_ID)
PRIMARY KEY (ID)
);
CREATE TABLE IF NOT EXISTS APPM_PLATFORM_PROPERTIES (
@ -121,7 +122,6 @@ INSERT INTO APPM_LIFECYCLE_STATE_TRANSITION(INITIAL_STATE, NEXT_STATE, PERMISSIO
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,

@ -7,6 +7,7 @@
-- -----------------------------------------------------
CREATE TABLE APPM_PLATFORM (
ID INT UNIQUE,
IDENTIFIER VARCHAR (100) NOT NULL,
TENANT_ID INT NOT NULL ,
NAME VARCHAR (255),
FILE_BASED NUMBER (1),
@ -14,7 +15,7 @@ DESCRIPTION VARCHAR (2048),
IS_SHARED NUMBER (1),
IS_DEFAULT_TENANT_MAPPING NUMBER (1),
ICON_NAME VARCHAR (100),
PRIMARY KEY (IDENTIFIER, TENANT_ID)
PRIMARY KEY (ID)
)
/

@ -4,6 +4,7 @@ CREATE SEQUENCE APPM_PLATFORM_PK_SEQ;
CREATE TABLE APPM_PLATFORM (
ID INT DEFAULT NEXTVAL('APPM_PLATFORM_PK_SEQ') UNIQUE,
IDENTIFIER VARCHAR (100) NOT NULL,
TENANT_ID INT NOT NULL ,
NAME VARCHAR (255),
FILE_BASED BOOLEAN,
@ -11,7 +12,7 @@ DESCRIPTION VARCHAR(2048),
IS_SHARED BOOLEAN,
IS_DEFAULT_TENANT_MAPPING BOOLEAN,
ICON_NAME VARCHAR (100),
PRIMARY KEY (IDENTIFIER, TENANT_ID)
PRIMARY KEY (ID)
);
DROP TABLE IF EXISTS APPM_PLATFORM_PROPERTIES;
@ -137,7 +138,6 @@ CREATE SEQUENCE APPM_APPLICATION_PK_SEQ;
CREATE TABLE IF NOT EXISTS APPM_APPLICATION (
ID INT DEFAULT NEXTVAL('APPM_APPLICATION_PK_SEQ') UNIQUE,
UUID VARCHAR(100) NOT NULL,
IDENTIFIER VARCHAR(255) NULL,
NAME VARCHAR(100) NOT NULL,
SHORT_DESCRIPTION VARCHAR(255) NULL,
DESCRIPTION TEXT NULL,

Loading…
Cancel
Save