diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java index 431369d4494..679f2ed7136 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java @@ -823,7 +823,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic log.error(msg, e); throw new ApplicationManagementDAOException(msg, 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; log.error(msg, e); throw new ApplicationManagementDAOException(msg, e); diff --git a/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql b/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql index 150480f68df..6b07c6b7579 100644 --- a/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql +++ b/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql @@ -278,3 +278,17 @@ CREATE TABLE IF NOT EXISTS AP_SCHEDULED_SUBSCRIPTION( FOREIGN KEY (APPLICATION_UUID) 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 +); diff --git a/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mssql.sql b/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mssql.sql index 5d29525a8c5..f1a41956995 100644 --- a/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mssql.sql +++ b/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mssql.sql @@ -278,4 +278,18 @@ CREATE TABLE AP_SCHEDULED_SUBSCRIPTION( CONSTRAINT fk_AP_SCHEDULED_SUBSCRIPTION_AP_APP_RELEASE FOREIGN KEY (APPLICATION_UUID) REFERENCES AP_APP_RELEASE (UUID) ON DELETE NO ACTION ON UPDATE NO ACTION -); \ No newline at end of file +); + +-- ----------------------------------------------------- +-- 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) +); diff --git a/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mysql.sql b/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mysql.sql index 110ccdc606d..375621018e8 100644 --- a/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mysql.sql +++ b/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mysql.sql @@ -274,4 +274,18 @@ CREATE TABLE IF NOT EXISTS AP_SCHEDULED_SUBSCRIPTION( SCHEDULED_TIMESTAMP TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, DELETED BOOLEAN, PRIMARY KEY (ID) -); \ No newline at end of file +); + +-- ----------------------------------------------------- +-- 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) +); diff --git a/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/oracle.sql b/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/oracle.sql index edbc277ab25..b15ef930f6a 100644 --- a/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/oracle.sql +++ b/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/oracle.sql @@ -382,3 +382,15 @@ CREATE TABLE AP_SCHEDULED_SUBSCRIPTION ( 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) +) +/ diff --git a/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/postgresql.sql b/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/postgresql.sql index c799b032453..e5f83986d68 100644 --- a/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/postgresql.sql +++ b/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/postgresql.sql @@ -305,3 +305,18 @@ CREATE TABLE IF NOT EXISTS AP_SCHEDULED_SUBSCRIPTION( DELETED BOOLEAN, 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 +);