diff --git a/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql b/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql index f9c58618315..e129d6f68eb 100644 --- a/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql +++ b/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql @@ -325,3 +325,57 @@ CREATE TABLE IF NOT EXISTS AP_APP_FAVOURITES( FOREIGN KEY (AP_APP_ID) REFERENCES AP_APP (ID) ON DELETE NO ACTION ON UPDATE NO ACTION ); + +-- ----------------------------------------------------- +-- Table AP_VPP_USER +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS AP_VPP_USER ( + ID INT NOT NULL AUTO_INCREMENT, + CLIENT_USER_ID VARCHAR(255) NULL, + DM_USERNAME VARCHAR(255) NOT NULL, + TENANT_ID INT NOT NULL, + EMAIL VARCHAR(255) NULL, + INVITE_CODE VARCHAR(255) NULL, + STATUS VARCHAR(255) NULL, + CREATED_TIME BIGINT NULL, + LAST_UPDATED_TIME BIGINT NULL, + MANAGED_ID VARCHAR(255) NULL, + TEMP_PASSWORD VARCHAR(255) NULL, + PRIMARY KEY (ID) +); + +-- ----------------------------------------------------- +-- Table AP_ASSETS +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS AP_ASSETS ( + ID INT NOT NULL AUTO_INCREMENT, + APP_ID INT NULL, + TENANT_ID INT NOT NULL, + CREATED_TIME BIGINT NULL, + LAST_UPDATED_TIME BIGINT NULL, + ADAM_ID VARCHAR(255) NULL, + ASSIGNED_COUNT VARCHAR(255) NULL, + DEVICE_ASSIGNABLE VARCHAR(255) NULL, + PRICING_PARAMS VARCHAR(255) NULL, + PRODUCT_TYPE VARCHAR(255) NULL, + RETIRED_COUNT VARCHAR(255) NULL, + REVOCABLE VARCHAR(255) NULL, + SUPPORTED_PLATFORMS VARCHAR(255) NULL, + PRIMARY KEY (ID) +); + +-- ----------------------------------------------------- +-- Table AP_VPP_ASSOCIATION +-- ----------------------------------------------------- + +CREATE TABLE IF NOT EXISTS AP_VPP_ASSOCIATION ( + ID INT NOT NULL AUTO_INCREMENT, + ASSET_ID INT, + USER_ID INT, + TENANT_ID INT NOT NULL, + ASSOCIATION_TYPE VARCHAR(255) NOT NULL, + PRICING_PARAMS VARCHAR(255) NULL, + PRIMARY KEY (ID), + CONSTRAINT AP_VPP_ASSETS_fk FOREIGN KEY (ASSET_ID) REFERENCES AP_ASSETS (ID) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT AP_VPP_VPP_USER_fk FOREIGN KEY (USER_ID) REFERENCES AP_VPP_USER (ID) ON DELETE CASCADE ON UPDATE CASCADE +); diff --git a/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mssql.sql b/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mssql.sql index 9b2e89b3f71..143d2f21030 100644 --- a/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mssql.sql +++ b/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mssql.sql @@ -342,3 +342,59 @@ CREATE TABLE AP_APP_FAVOURITES( FOREIGN KEY (AP_APP_ID) REFERENCES AP_APP (ID) ); + +-- ----------------------------------------------------- +-- Table AP_VPP_USER +-- ----------------------------------------------------- +IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'AP_VPP_USER') AND type in (N'U')) +CREATE TABLE AP_VPP_USER ( + ID INT NOT NULL IDENTITY(1,1), + CLIENT_USER_ID VARCHAR(255) NULL, + DM_USERNAME VARCHAR(255) NOT NULL, + TENANT_ID INT NOT NULL, + EMAIL VARCHAR(255) NULL, + INVITE_CODE VARCHAR(255) NULL, + STATUS VARCHAR(255) NULL, + CREATED_TIME BIGINT NULL, + LAST_UPDATED_TIME BIGINT NULL, + MANAGED_ID VARCHAR(255) NULL, + TEMP_PASSWORD VARCHAR(255) NULL, + PRIMARY KEY (ID) +); + +-- ----------------------------------------------------- +-- Table AP_ASSETS +-- ----------------------------------------------------- +IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'AP_ASSETS') AND type in (N'U')) +CREATE TABLE AP_ASSETS ( + ID INT NOT NULL IDENTITY(1,1), + APP_ID INT NULL, + TENANT_ID INT NOT NULL, + CREATED_TIME BIGINT NULL, + LAST_UPDATED_TIME BIGINT NULL, + ADAM_ID VARCHAR(255) NULL, + ASSIGNED_COUNT VARCHAR(255) NULL, + DEVICE_ASSIGNABLE VARCHAR(255) NULL, + PRICING_PARAMS VARCHAR(255) NULL, + PRODUCT_TYPE VARCHAR(255) NULL, + RETIRED_COUNT VARCHAR(255) NULL, + REVOCABLE VARCHAR(255) NULL, + SUPPORTED_PLATFORMS VARCHAR(255) NULL, + PRIMARY KEY (ID) +); + +-- ----------------------------------------------------- +-- Table AP_VPP_ASSOCIATION +-- ----------------------------------------------------- +IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'AP_VPP_ASSOCIATION') AND type in (N'U')) +CREATE TABLE AP_VPP_ASSOCIATION ( + ID INT NOT NULL IDENTITY(1,1), + ASSET_ID INT, + USER_ID INT, + TENANT_ID INT NOT NULL, + ASSOCIATION_TYPE VARCHAR(255) NOT NULL, + PRICING_PARAMS VARCHAR(255) NULL, + PRIMARY KEY (ID), + CONSTRAINT AP_VPP_ASSETS_fk FOREIGN KEY (ASSET_ID) REFERENCES AP_ASSETS (ID) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT AP_VPP_VPP_USER_fk FOREIGN KEY (USER_ID) REFERENCES AP_VPP_USER (ID) ON DELETE CASCADE ON UPDATE CASCADE +); diff --git a/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mysql.sql b/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mysql.sql index 54ba58a9fe2..d1ae7590843 100644 --- a/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mysql.sql +++ b/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mysql.sql @@ -272,4 +272,58 @@ CREATE TABLE IF NOT EXISTS AP_APP_FAVOURITES( 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) +); + +-- ----------------------------------------------------- +-- Table AP_VPP_USER +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS AP_VPP_USER ( + ID INT NOT NULL AUTO_INCREMENT, + CLIENT_USER_ID VARCHAR(255) NULL, + DM_USERNAME VARCHAR(255) NOT NULL, + TENANT_ID INT NOT NULL, + EMAIL VARCHAR(255) NULL, + INVITE_CODE VARCHAR(255) NULL, + STATUS VARCHAR(255) NULL, + CREATED_TIME BIGINT NULL, + LAST_UPDATED_TIME BIGINT NULL, + MANAGED_ID VARCHAR(255) NULL, + TEMP_PASSWORD VARCHAR(255) NULL, + PRIMARY KEY (ID) +); + +-- ----------------------------------------------------- +-- Table AP_ASSETS +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS AP_ASSETS ( + ID INT NOT NULL AUTO_INCREMENT, + APP_ID INT NULL, + TENANT_ID INT NOT NULL, + CREATED_TIME BIGINT NULL, + LAST_UPDATED_TIME BIGINT NULL, + ADAM_ID VARCHAR(255) NULL, + ASSIGNED_COUNT VARCHAR(255) NULL, + DEVICE_ASSIGNABLE VARCHAR(255) NULL, + PRICING_PARAMS VARCHAR(255) NULL, + PRODUCT_TYPE VARCHAR(255) NULL, + RETIRED_COUNT VARCHAR(255) NULL, + REVOCABLE VARCHAR(255) NULL, + SUPPORTED_PLATFORMS VARCHAR(255) NULL, + PRIMARY KEY (ID) +); + +-- ----------------------------------------------------- +-- Table AP_VPP_ASSOCIATION +-- ----------------------------------------------------- + +CREATE TABLE IF NOT EXISTS AP_VPP_ASSOCIATION ( + ID INT NOT NULL AUTO_INCREMENT, + ASSET_ID INT, + USER_ID INT, + TENANT_ID INT NOT NULL, + ASSOCIATION_TYPE VARCHAR(255) NOT NULL, + PRICING_PARAMS VARCHAR(255) NULL, + PRIMARY KEY (ID), + CONSTRAINT AP_VPP_ASSETS_fk FOREIGN KEY (ASSET_ID) REFERENCES AP_ASSETS (ID) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT AP_VPP_VPP_USER_fk FOREIGN KEY (USER_ID) REFERENCES AP_VPP_USER (ID) ON DELETE CASCADE ON UPDATE CASCADE ); \ No newline at end of file diff --git a/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/oracle.sql b/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/oracle.sql index 79c5b1345fd..c2f82d7e394 100644 --- a/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/oracle.sql +++ b/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/oracle.sql @@ -420,3 +420,50 @@ CREATE TABLE IF NOT EXISTS AP_APP_FAVOURITES( REFERENCES AP_APP (ID) ) / + +CREATE TABLE AP_VPP_USER ( + ID number GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL, + CLIENT_USER_ID VARCHAR2(255) NULL, + DM_USERNAME VARCHAR2(255) NOT NULL, + TENANT_ID INT NOT NULL, + EMAIL VARCHAR2(255) NULL, + INVITE_CODE VARCHAR2(255) NULL, + STATUS VARCHAR2(255) NULL, + CREATED_TIME NUMBER(19) NULL, + LAST_UPDATED_TIME NUMBER(19) NULL, + MANAGED_ID VARCHAR2(255) NULL, + TEMP_PASSWORD VARCHAR2(255) NULL, + PRIMARY KEY (ID) +) +/ + +CREATE TABLE AP_ASSETS ( + ID number GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL, + APP_ID INT NULL, + TENANT_ID INT NOT NULL, + CREATED_TIME NUMBER(19) NULL, + LAST_UPDATED_TIME NUMBER(19) NULL, + ADAM_ID VARCHAR2(255) NULL, + ASSIGNED_COUNT VARCHAR2(255) NULL, + DEVICE_ASSIGNABLE VARCHAR2(255) NULL, + PRICING_PARAMS VARCHAR2(255) NULL, + PRODUCT_TYPE VARCHAR2(255) NULL, + RETIRED_COUNT VARCHAR2(255) NULL, + REVOCABLE VARCHAR2(255) NULL, + SUPPORTED_PLATFORMS VARCHAR2(255) NULL, + PRIMARY KEY (ID) +) +/ + +CREATE TABLE AP_VPP_ASSOCIATION ( + ID number GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL, + ASSET_ID INT, + USER_ID INT, + TENANT_ID INT NOT NULL, + ASSOCIATION_TYPE VARCHAR2(255) NOT NULL, + PRICING_PARAMS VARCHAR2(255) NULL, + PRIMARY KEY (ID), + CONSTRAINT AP_VPP_ASSETS_fk FOREIGN KEY (ASSET_ID) REFERENCES AP_ASSETS (ID) ON DELETE CASCADE, + CONSTRAINT AP_VPP_VPP_USER_fk FOREIGN KEY (USER_ID) REFERENCES AP_VPP_USER (ID) ON DELETE CASCADE +) +/ diff --git a/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/postgresql.sql b/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/postgresql.sql index e8e1dbb2250..f1645de58b1 100644 --- a/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/postgresql.sql +++ b/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/postgresql.sql @@ -352,3 +352,56 @@ CREATE TABLE IF NOT EXISTS AP_APP_FAVOURITES( FOREIGN KEY (AP_APP_ID) REFERENCES AP_APP (ID) ON DELETE NO ACTION ON UPDATE NO ACTION ); + +-- ----------------------------------------------------- +-- Table AP_VPP_USER +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS AP_VPP_USER ( + ID INTEGER NOT NULL DEFAULT NEXTVAL('AP_VPP_USER_seq'), + CLIENT_USER_ID VARCHAR(255) NULL, + DM_USERNAME VARCHAR(255) NOT NULL, + TENANT_ID INTEGER NOT NULL, + EMAIL VARCHAR(255) NULL, + INVITE_CODE VARCHAR(255) NULL, + STATUS VARCHAR(255) NULL, + CREATED_TIME BIGINT NULL, + LAST_UPDATED_TIME BIGINT NULL, + MANAGED_ID VARCHAR(255) NULL, + TEMP_PASSWORD VARCHAR(255) NULL, + PRIMARY KEY (ID) + ); + +-- ----------------------------------------------------- +-- Table AP_ASSETS +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS AP_ASSETS ( + ID INTEGER NOT NULL DEFAULT NEXTVAL('AP_ASSETS_seq'), + APP_ID INTEGER NULL, + TENANT_ID INTEGER NOT NULL, + CREATED_TIME BIGINT NULL, + LAST_UPDATED_TIME BIGINT NULL, + ADAM_ID VARCHAR(255) NULL, + ASSIGNED_COUNT VARCHAR(255) NULL, + DEVICE_ASSIGNABLE VARCHAR(255) NULL, + PRICING_PARAMS VARCHAR(255) NULL, + PRODUCT_TYPE VARCHAR(255) NULL, + RETIRED_COUNT VARCHAR(255) NULL, + REVOCABLE VARCHAR(255) NULL, + SUPPORTED_PLATFORMS VARCHAR(255) NULL, + PRIMARY KEY (ID) + ); + +-- ----------------------------------------------------- +-- Table AP_VPP_ASSOCIATION +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS AP_VPP_ASSOCIATION ( + ID INTEGER NOT NULL DEFAULT NEXTVAL('AP_VPP_ASSOCIATION_seq'), + ASSET_ID INTEGER, + USER_ID INTEGER, + TENANT_ID INTEGER NOT NULL, + ASSOCIATION_TYPE VARCHAR(255) NOT NULL, + PRICING_PARAMS VARCHAR(255) NULL, + PRIMARY KEY (ID), + CONSTRAINT AP_VPP_ASSETS_fk FOREIGN KEY (ASSET_ID) REFERENCES AP_ASSETS (ID) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT AP_VPP_VPP_USER_fk FOREIGN KEY (USER_ID) REFERENCES AP_VPP_USER (ID) ON DELETE CASCADE ON UPDATE CASCADE + );