Add sql scripts to favourites table

Fix error logging in DAO layer
temp
Mohamed Rashd 3 years ago
parent 788eea4e26
commit c0e5edded2

@ -823,7 +823,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
log.error(msg, e); log.error(msg, e);
throw new ApplicationManagementDAOException(msg, e); throw new ApplicationManagementDAOException(msg, e);
} catch (SQLException e) { } catch (SQLException e) {
String msg = "Error occurred while obtaining the DB connection to check whether the application with the id " String msg = "SQL Error occurred while checking whether the application with the id "
+ appId + " is a favourite app. executed query " + sql; + appId + " is a favourite app. executed query " + sql;
log.error(msg, e); log.error(msg, e);
throw new ApplicationManagementDAOException(msg, e); throw new ApplicationManagementDAOException(msg, e);

@ -278,3 +278,17 @@ CREATE TABLE IF NOT EXISTS AP_SCHEDULED_SUBSCRIPTION(
FOREIGN KEY (APPLICATION_UUID) FOREIGN KEY (APPLICATION_UUID)
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_APP_FAVOURITES
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AP_APP_FAVOURITES(
ID INTEGER NOT NULL AUTO_INCREMENT,
AP_APP_ID INTEGER NOT NULL,
USER_NAME VARCHAR(100) NOT NULL,
TENANT_ID INTEGER NOT NULL,
PRIMARY KEY(ID),
CONSTRAINT AP_APP_FAVOURITES_AP_APP_ID_fk
FOREIGN KEY (AP_APP_ID)
REFERENCES AP_APP (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);

@ -279,3 +279,17 @@ CREATE TABLE AP_SCHEDULED_SUBSCRIPTION(
FOREIGN KEY (APPLICATION_UUID) FOREIGN KEY (APPLICATION_UUID)
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_APP_FAVOURITES
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AP_APP_FAVOURITES(
ID INTEGER NOT NULL IDENTITY,
AP_APP_ID INTEGER NOT NULL,
USER_NAME VARCHAR(100) NOT NULL,
TENANT_ID INTEGER NOT NULL,
PRIMARY KEY(ID),
CONSTRAINT AP_APP_FAVOURITES_AP_APP_ID_fk
FOREIGN KEY (AP_APP_ID)
REFERENCES AP_APP (ID)
);

@ -275,3 +275,17 @@ CREATE TABLE IF NOT EXISTS AP_SCHEDULED_SUBSCRIPTION(
DELETED BOOLEAN, DELETED BOOLEAN,
PRIMARY KEY (ID) PRIMARY KEY (ID)
); );
-- -----------------------------------------------------
-- Table AP_APP_FAVOURITES
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AP_APP_FAVOURITES(
ID INTEGER NOT NULL AUTO_INCREMENT,
AP_APP_ID INTEGER NOT NULL,
USER_NAME VARCHAR(100) NOT NULL,
TENANT_ID INTEGER NOT NULL,
PRIMARY KEY(ID),
CONSTRAINT AP_APP_FAVOURITES_AP_APP_ID_fk
FOREIGN KEY (AP_APP_ID)
REFERENCES AP_APP (ID)
);

@ -382,3 +382,15 @@ CREATE TABLE AP_SCHEDULED_SUBSCRIPTION (
REFERENCES AP_APP_RELEASE (UUID) REFERENCES AP_APP_RELEASE (UUID)
) )
/ /
CREATE TABLE IF NOT EXISTS AP_APP_FAVOURITES(
ID number GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL,
AP_APP_ID INTEGER NOT NULL,
USER_NAME VARCHAR(100) NOT NULL,
TENANT_ID INTEGER NOT NULL,
PRIMARY KEY(ID),
CONSTRAINT AP_APP_FAVOURITES_AP_APP_ID_fk
FOREIGN KEY (AP_APP_ID)
REFERENCES AP_APP (ID)
)
/

@ -305,3 +305,18 @@ CREATE TABLE IF NOT EXISTS AP_SCHEDULED_SUBSCRIPTION(
DELETED BOOLEAN, DELETED BOOLEAN,
PRIMARY KEY (ID) PRIMARY KEY (ID)
); );
-- -----------------------------------------------------
-- Table AP_APP_FAVOURITES
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AP_APP_FAVOURITES(
ID INTEGER NOT NULL DEFAULT NEXTVAL ('AP_APP_FAVOURITES_seq'),
AP_APP_ID INTEGER NOT NULL,
USER_NAME VARCHAR(100) NOT NULL,
TENANT_ID INTEGER NOT NULL,
PRIMARY KEY(ID),
CONSTRAINT AP_APP_FAVOURITES_AP_APP_ID_fk
FOREIGN KEY (AP_APP_ID)
REFERENCES AP_APP (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);

Loading…
Cancel
Save