Merge branch 'fix/sp-app/dbscripts' into 'master'

Fix service provider app integration dbscripts

See merge request entgra/carbon-device-mgt!883
master
Pahansith Gunathilake 3 years ago
commit fb331e0089

@ -279,6 +279,38 @@ CREATE TABLE IF NOT EXISTS AP_SCHEDULED_SUBSCRIPTION(
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
); );
-- -----------------------------------------------------
-- Table AP_IDENTITY_SERVER
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AP_IDENTITY_SERVER (
ID INTEGER NOT NULL AUTO_INCREMENT,
NAME VARCHAR(255) NOT NULL,
PROVIDER_NAME VARCHAR(255) NOT NULL,
DESCRIPTION VARCHAR(255) NOT NULL,
URL VARCHAR(255) NOT NULL,
API_PARAMS VARCHAR(255) NOT NULL,
USERNAME VARCHAR(255) NOT NULL,
PASSWORD VARCHAR(255) NOT NULL
TENANT_ID INT NOT NULL,
PRIMARY KEY(ID)
);
-- -----------------------------------------------------
-- Table AP_IS_SP_APP_MAPPING
-- -----------------------------------------------------;
CREATE TABLE IF NOT EXISTS AP_IS_SP_APP_MAPPING (
ID INTEGER NOT NULL AUTO_INCREMENT,
SP_UID VARCHAR(255) NOT NULL,
AP_APP_ID INT NOT NULL,
IS_ID INT NOT NULL,
TENANT_ID INT NOT NULL,
PRIMARY KEY(ID),
CONSTRAINT AP_IS_SP_APP_MAPPING_AP_APP_ID_fk FOREIGN KEY (AP_APP_ID) REFERENCES AP_APP (ID)
ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT AP_IS_SP_APP_MAPPING_AP_IDENTITY_SERVER_ID_fk FOREIGN KEY (IS_ID) REFERENCES AP_IDENTITY_SERVER (ID)
ON DELETE NO ACTION ON UPDATE NO ACTION
);
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table AP_APP_FAVOURITES -- Table AP_APP_FAVOURITES
-- ----------------------------------------------------- -- -----------------------------------------------------

@ -280,6 +280,36 @@ CREATE TABLE AP_SCHEDULED_SUBSCRIPTION(
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
); );
-- -----------------------------------------------------
-- Table AP_IDENTITY_SERVER
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AP_IDENTITY_SERVER (
ID INTEGER NOT NULL IDENTITY,
NAME VARCHAR(255) NOT NULL,
PROVIDER_NAME VARCHAR(255) NOT NULL,
DESCRIPTION VARCHAR(255) NOT NULL,
URL VARCHAR(255) NOT NULL,
API_PARAMS VARCHAR(255) NOT NULL,
USERNAME VARCHAR(255) NOT NULL,
PASSWORD VARCHAR(255) NOT NULL
TENANT_ID INT NOT NULL,
PRIMARY KEY(ID)
);
-- -----------------------------------------------------
-- Table AP_IS_SP_APP_MAPPING
-- -----------------------------------------------------;
CREATE TABLE IF NOT EXISTS AP_IS_SP_APP_MAPPING (
ID INTEGER NOT NULL IDENTITY,
SP_UID VARCHAR(255) NOT NULL,
AP_APP_ID INT NOT NULL,
IS_ID INT NOT NULL,
TENANT_ID INT NOT NULL,
PRIMARY KEY(ID),
CONSTRAINT AP_IS_SP_APP_MAPPING_AP_APP_ID_fk FOREIGN KEY (AP_APP_ID) REFERENCES AP_APP (ID),
CONSTRAINT AP_IS_SP_APP_MAPPING_AP_IDENTITY_SERVER_ID_fk FOREIGN KEY (IS_ID) REFERENCES AP_IDENTITY_SERVER (ID)
);
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table AP_APP_FAVOURITES -- Table AP_APP_FAVOURITES
-- ----------------------------------------------------- -- -----------------------------------------------------

@ -242,15 +242,16 @@ CREATE TABLE IF NOT EXISTS AP_IDENTITY_SERVER (
ID INT AUTO_INCREMENT PRIMARY KEY, ID INT AUTO_INCREMENT PRIMARY KEY,
NAME VARCHAR(255) NOT NULL, NAME VARCHAR(255) NOT NULL,
DESCRIPTION VARCHAR(255) NOT NULL, DESCRIPTION VARCHAR(255) NOT NULL,
PROVIDER_NAME VARCHAR(255) NOT NULL,
URL VARCHAR(255) NOT NULL, URL VARCHAR(255) NOT NULL,
SP_APPS_URI VARCHAR(255) NOT NULL, API_PARAMS TEXT NOT NULL,
SP_APPS_API VARCHAR(255) NULL,
TENANT_ID INT NOT NULL,
USERNAME VARCHAR(255) NOT NULL, USERNAME VARCHAR(255) NOT NULL,
PASSWORD VARCHAR(255) NOT NULL PASSWORD VARCHAR(255) NOT NULL
) -- ----------------------------------------------------- TENANT_ID INT NOT NULL,
);
-- -----------------------------------------------------
-- Table AP_IS_SP_APP_MAPPING -- Table AP_IS_SP_APP_MAPPING
-- -----------------------------------------------------; -- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AP_IS_SP_APP_MAPPING ( CREATE TABLE IF NOT EXISTS AP_IS_SP_APP_MAPPING (
ID INT AUTO_INCREMENT PRIMARY KEY, ID INT AUTO_INCREMENT PRIMARY KEY,
SP_UID VARCHAR(255) NOT NULL, SP_UID VARCHAR(255) NOT NULL,
@ -260,6 +261,7 @@ CREATE TABLE IF NOT EXISTS AP_IS_SP_APP_MAPPING (
CONSTRAINT AP_IS_SP_APP_MAPPING_AP_APP_ID_fk FOREIGN KEY (AP_APP_ID) REFERENCES AP_APP (ID), CONSTRAINT AP_IS_SP_APP_MAPPING_AP_APP_ID_fk FOREIGN KEY (AP_APP_ID) REFERENCES AP_APP (ID),
CONSTRAINT AP_IS_SP_APP_MAPPING_AP_IDENTITY_SERVER_ID_fk FOREIGN KEY (IS_ID) REFERENCES AP_IDENTITY_SERVER (ID) CONSTRAINT AP_IS_SP_APP_MAPPING_AP_IDENTITY_SERVER_ID_fk FOREIGN KEY (IS_ID) REFERENCES AP_IDENTITY_SERVER (ID)
); );
-- -----------------------------------------------------
-- Table AP_APP_FAVOURITES -- Table AP_APP_FAVOURITES
-- ----------------------------------------------------- -- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AP_APP_FAVOURITES( CREATE TABLE IF NOT EXISTS AP_APP_FAVOURITES(

@ -383,6 +383,32 @@ CREATE TABLE AP_SCHEDULED_SUBSCRIPTION (
) )
/ /
CREATE TABLE IF NOT EXISTS AP_IDENTITY_SERVER (
ID number GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL,
NAME VARCHAR(255) NOT NULL,
PROVIDER_NAME VARCHAR(255) NOT NULL,
DESCRIPTION VARCHAR(255) NOT NULL,
URL VARCHAR(255) NOT NULL,
API_PARAMS VARCHAR(255) NOT NULL,
USERNAME VARCHAR(255) NOT NULL,
PASSWORD VARCHAR(255) NOT NULL
TENANT_ID INT NOT NULL,
PRIMARY KEY(ID)
)
/
CREATE TABLE IF NOT EXISTS AP_IS_SP_APP_MAPPING (
ID number GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL,
SP_UID VARCHAR(255) NOT NULL,
AP_APP_ID INT NOT NULL,
IS_ID INT NOT NULL,
TENANT_ID INT NOT NULL,
PRIMARY KEY(ID),
CONSTRAINT AP_IS_SP_APP_MAPPING_AP_APP_ID_fk FOREIGN KEY (AP_APP_ID) REFERENCES AP_APP (ID),
CONSTRAINT AP_IS_SP_APP_MAPPING_AP_IDENTITY_SERVER_ID_fk FOREIGN KEY (IS_ID) REFERENCES AP_IDENTITY_SERVER (ID)
)
/
CREATE TABLE IF NOT EXISTS AP_APP_FAVOURITES( CREATE TABLE IF NOT EXISTS AP_APP_FAVOURITES(
ID number GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL, ID number GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL,
AP_APP_ID INTEGER NOT NULL, AP_APP_ID INTEGER NOT NULL,

@ -306,6 +306,37 @@ CREATE TABLE IF NOT EXISTS AP_SCHEDULED_SUBSCRIPTION(
PRIMARY KEY (ID) PRIMARY KEY (ID)
); );
-- -----------------------------------------------------
-- Table AP_IDENTITY_SERVER
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AP_IDENTITY_SERVER (
ID INTEGER NOT NULL DEFAULT NEXTVAL ('AP_IDENTITY_SERVER_seq'),
NAME VARCHAR(255) NOT NULL,
PROVIDER_NAME VARCHAR(255) NOT NULL,
DESCRIPTION VARCHAR(255) NOT NULL,
URL VARCHAR(255) NOT NULL,
API_PARAMS VARCHAR(255) NOT NULL,
USERNAME VARCHAR(255) NOT NULL,
PASSWORD VARCHAR(255) NOT NULL
TENANT_ID INT NOT NULL,
PRIMARY KEY(ID)
);
-- -----------------------------------------------------
-- Table AP_IS_SP_APP_MAPPING
-- -----------------------------------------------------;
CREATE TABLE IF NOT EXISTS AP_IS_SP_APP_MAPPING (
ID INTEGER NOT NULL DEFAULT NEXTVAL ('AP_IS_SP_APP_MAPPING_seq'),
SP_UID VARCHAR(255) NOT NULL,
AP_APP_ID INT NOT NULL,
IS_ID INT NOT NULL,
TENANT_ID INT NOT NULL,
PRIMARY KEY(ID),
CONSTRAINT AP_IS_SP_APP_MAPPING_AP_APP_ID_fk FOREIGN KEY (AP_APP_ID) REFERENCES AP_APP (ID)
ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT AP_IS_SP_APP_MAPPING_AP_IDENTITY_SERVER_ID_fk FOREIGN KEY (IS_ID) REFERENCES AP_IDENTITY_SERVER (ID)
ON DELETE NO ACTION ON UPDATE NO ACTION
);
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table AP_APP_FAVOURITES -- Table AP_APP_FAVOURITES

Loading…
Cancel
Save