forked from community/device-mgt-core
parent
612905bc5f
commit
1ab9807dbd
4
components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/platform/OraclePlatformDAOImpl.java → components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/platform/OracleMsSQLPlatformDAOImpl.java
4
components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/platform/OraclePlatformDAOImpl.java → components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/platform/OracleMsSQLPlatformDAOImpl.java
@ -1,44 +1,35 @@
|
||||
CREATE TABLE IF NOT EXISTS APPM_APPLICATION_TYPE (
|
||||
ID INTEGER AUTO_INCREMENT,
|
||||
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),
|
||||
DESCRIPTION TEXT,
|
||||
CODE VARCHAR (255),
|
||||
PARAMTERS LONGTEXT,
|
||||
PRIMARY KEY (ID)
|
||||
)ENGINE INNODB;
|
||||
FILE_BASED BIT,
|
||||
DESCRIPTION VARCHAR(2048),
|
||||
IS_SHARED BIT,
|
||||
IS_DEFAULT_TENANT_MAPPING BIT,
|
||||
ICON_NAME VARCHAR (100),
|
||||
PRIMARY KEY (IDENTIFIER, TENANT_ID)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS APPM_APPLICATION_CATEGORY (
|
||||
ID INTEGER AUTO_INCREMENT,
|
||||
NAME VARCHAR (255),
|
||||
DESCRIPTION TEXT,
|
||||
PRIMARY KEY (ID)
|
||||
)ENGINE INNODB;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS APPM_APPLICATION (
|
||||
ID INTEGER AUTO_INCREMENT,
|
||||
NAME VARCHAR (255),
|
||||
UUID VARCHAR (255),
|
||||
DESCRIPTION MEDIUMTEXT,
|
||||
ICON_NAME VARCHAR (255),
|
||||
BANNER_NAME VARCHAR (255),
|
||||
VIDEO_NAME VARCHAR (255),
|
||||
SCREENSHOTS TEXT,
|
||||
TAGS TEXT,
|
||||
APPLICATION_TYPE_ID INTEGER,
|
||||
CATEGORY_ID INTEGER,
|
||||
CREATED_AT DATETIME,
|
||||
MODIFIED_AT DATETIME,
|
||||
PRIMARY KEY (ID),
|
||||
FOREIGN KEY (CATEGORY_ID) REFERENCES APPM_APPLICATION_CATEGORY(ID),
|
||||
FOREIGN KEY (APPLICATION_TYPE_ID) REFERENCES APPM_APPLICATION_TYPE(ID)
|
||||
)ENGINE INNODB;
|
||||
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[APPM_PLATFORM_PROPERTIES]') AND TYPE IN (N'U'))
|
||||
CREATE TABLE APPM_PLATFORM_PROPERTIES (
|
||||
ID INT IDENTITY(1,1) NOT NULL,
|
||||
PLATFORM_ID INT NOT NULL,
|
||||
PROP_NAME VARCHAR (100) NOT NULL,
|
||||
OPTIONAL BIT,
|
||||
DEFAUL_VALUE VARCHAR (255),
|
||||
FOREIGN KEY(PLATFORM_ID) REFERENCES APPM_PLATFORM(ID) ON DELETE CASCADE,
|
||||
PRIMARY KEY (ID, PLATFORM_ID, PROP_NAME)
|
||||
);
|
||||
|
||||
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[APPM_PLATFORM_TENANT_MAPPING]') AND TYPE IN (N'U'))
|
||||
CREATE TABLE APPM_PLATFORM_TENANT_MAPPING (
|
||||
ID INT IDENTITY(1,1) NOT NULL,
|
||||
TENANT_ID INT NOT NULL ,
|
||||
PLATFORM_ID INT NOT NULL,
|
||||
FOREIGN KEY(PLATFORM_ID) REFERENCES APPM_PLATFORM(ID) ON DELETE CASCADE,
|
||||
PRIMARY KEY (ID, TENANT_ID, PLATFORM_ID)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS APPM_APPLICATION_PROPERTIES (
|
||||
PROP_KEY VARCHAR (255),
|
||||
PROP_VAL MEDIUMTEXT,
|
||||
APPLICATION_ID INTEGER,
|
||||
PRIMARY KEY (APPLICATION_ID, PROP_KEY),
|
||||
FOREIGN KEY (APPLICATION_ID) REFERENCES APPM_APPLICATION(ID)
|
||||
)ENGINE INNODB;
|
||||
CREATE INDEX FK_PLATFROM_TENANT_MAPPING_PLATFORM ON APPM_PLATFORM_TENANT_MAPPING(PLATFORM_ID ASC);
|
@ -1,44 +1,44 @@
|
||||
CREATE TABLE IF NOT EXISTS APPM_APPLICATION_TYPE (
|
||||
ID INTEGER AUTO_INCREMENT,
|
||||
NAME VARCHAR (255),
|
||||
DESCRIPTION TEXT,
|
||||
CODE VARCHAR (255),
|
||||
PARAMTERS LONGTEXT,
|
||||
PRIMARY KEY (ID)
|
||||
)ENGINE INNODB;
|
||||
DROP TABLE IF EXISTS APPM_PLATFORM;
|
||||
DROP SEQUENCE IF EXISTS APPM_PLATFORM_PK_SEQ;
|
||||
CREATE SEQUENCE APPM_PLATFORM_PK_SEQ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS APPM_APPLICATION_CATEGORY (
|
||||
ID INTEGER AUTO_INCREMENT,
|
||||
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),
|
||||
DESCRIPTION TEXT,
|
||||
PRIMARY KEY (ID)
|
||||
)ENGINE INNODB;
|
||||
FILE_BASED BOOLEAN,
|
||||
DESCRIPTION VARCHAR(2048),
|
||||
IS_SHARED BOOLEAN,
|
||||
IS_DEFAULT_TENANT_MAPPING BOOLEAN,
|
||||
ICON_NAME VARCHAR (100),
|
||||
PRIMARY KEY (IDENTIFIER, TENANT_ID)
|
||||
);
|
||||
|
||||
DROP TABLE IF EXISTS APPM_PLATFORM_PROPERTIES;
|
||||
DROP SEQUENCE IF EXISTS APPM_PLATFORM_PROPERTIES_PK_SEQ;
|
||||
CREATE SEQUENCE APPM_PLATFORM_PROPERTIES_PK_SEQ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS APPM_APPLICATION (
|
||||
ID INTEGER AUTO_INCREMENT,
|
||||
NAME VARCHAR (255),
|
||||
UUID VARCHAR (255),
|
||||
DESCRIPTION MEDIUMTEXT,
|
||||
ICON_NAME VARCHAR (255),
|
||||
BANNER_NAME VARCHAR (255),
|
||||
VIDEO_NAME VARCHAR (255),
|
||||
SCREENSHOTS TEXT,
|
||||
TAGS TEXT,
|
||||
APPLICATION_TYPE_ID INTEGER,
|
||||
CATEGORY_ID INTEGER,
|
||||
CREATED_AT DATETIME,
|
||||
MODIFIED_AT DATETIME,
|
||||
PRIMARY KEY (ID),
|
||||
FOREIGN KEY (CATEGORY_ID) REFERENCES APPM_APPLICATION_CATEGORY(ID),
|
||||
FOREIGN KEY (APPLICATION_TYPE_ID) REFERENCES APPM_APPLICATION_TYPE(ID)
|
||||
)ENGINE INNODB;
|
||||
CREATE TABLE APPM_PLATFORM_PROPERTIES (
|
||||
ID INT DEFAULT NEXTVAL('APPM_PLATFORM_PROPERTIES_PK_SEQ'),
|
||||
PLATFORM_ID INT NOT NULL,
|
||||
PROP_NAME VARCHAR (100) NOT NULL,
|
||||
OPTIONAL BOOLEAN,
|
||||
DEFAUL_VALUE VARCHAR (255),
|
||||
FOREIGN KEY(PLATFORM_ID) REFERENCES APPM_PLATFORM(ID) ON DELETE CASCADE,
|
||||
PRIMARY KEY (ID, PLATFORM_ID, PROP_NAME)
|
||||
);
|
||||
|
||||
DROP TABLE IF EXISTS APPM_PLATFORM_TENANT_MAPPING;
|
||||
DROP SEQUENCE IF EXISTS APPM_PLATFORM_TENANT_MAPPING_PK_SEQ;
|
||||
CREATE SEQUENCE APPM_PLATFORM_TENANT_MAPPING_PK_SEQ;
|
||||
|
||||
CREATE TABLE APPM_PLATFORM_TENANT_MAPPING (
|
||||
ID INT DEFAULT NEXTVAL('APPM_PLATFORM_TENANT_MAPPING_PK_SEQ'),
|
||||
TENANT_ID INT NOT NULL ,
|
||||
PLATFORM_ID INT NOT NULL,
|
||||
FOREIGN KEY(PLATFORM_ID) REFERENCES APPM_PLATFORM(ID) ON DELETE CASCADE,
|
||||
PRIMARY KEY (ID, TENANT_ID, PLATFORM_ID)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS APPM_APPLICATION_PROPERTIES (
|
||||
PROP_KEY VARCHAR (255),
|
||||
PROP_VAL MEDIUMTEXT,
|
||||
APPLICATION_ID INTEGER,
|
||||
PRIMARY KEY (APPLICATION_ID, PROP_KEY),
|
||||
FOREIGN KEY (APPLICATION_ID) REFERENCES APPM_APPLICATION(ID)
|
||||
)ENGINE INNODB;
|
||||
CREATE INDEX FK_PLATFROM_TENANT_MAPPING_PLATFORM ON APPM_PLATFORM_TENANT_MAPPING(PLATFORM_ID ASC);
|
Loading…
Reference in new issue