openjpa/openjpa-integration/tck/sql/db2.sql

38 lines
3.5 KiB
SQL

-- =======================================================================
-- com.sun.ts.tests.ejb30.persistence.entitytest.cascadeall.oneXone
DROP TABLE AEJB_1X1_BI_BTOB !
CREATE TABLE AEJB_1X1_BI_BTOB (id VARCHAR(255) NOT NULL, name VARCHAR(255), value INTEGER, PRIMARY KEY (id)) !
DROP TABLE BEJB_1X1_BI_BTOB !
CREATE TABLE BEJB_1X1_BI_BTOB (id VARCHAR(255) NOT NULL, name VARCHAR(255), value INTEGER, FK_FOR_AEJB_1X1_BI_BTOB VARCHAR(255), PRIMARY KEY (id)) !
CREATE INDEX I_BJ1X1B_BTB_A1 ON BEJB_1X1_BI_BTOB (FK_FOR_AEJB_1X1_BI_BTOB) !
-- ALTER TABLE BEJB_1X1_BI_BTOB ADD CONSTRAINT FK_FOR_AEJB_1X1_BI FOREIGN KEY (FK_FOR_AEJB_1X1_BI_BTOB) REFERENCES AEJB_1X1_BI_BTOB (ID) !
-- =======================================================================
-- com.sun.ts.tests.ejb30.persistence.entitytest.cascadeall.oneXmany
DROP TABLE AEJB_1XM_BI_BTOB !
CREATE TABLE AEJB_1XM_BI_BTOB (id VARCHAR(255) NOT NULL, name VARCHAR(255), value INTEGER, PRIMARY KEY (id)) !
DROP TABLE BEJB_1XM_BI_BTOB !
CREATE TABLE BEJB_1XM_BI_BTOB (id VARCHAR(255) NOT NULL, name VARCHAR(255), value INTEGER, FK_FOR_AEJB_1XM_BI_BTOB VARCHAR(255), PRIMARY KEY (id)) !
CREATE INDEX I_BJ1XMTB_A1 ON BEJB_1XM_BI_BTOB (FK_FOR_AEJB_1XM_BI_BTOB) !
-- ALTER TABLE BEJB_1XM_BI_BTOB ADD CONSTRAINT FK_FOR_AEJB_1XM_BI FOREIGN KEY (FK_FOR_AEJB_1XM_BI_BTOB) REFERENCES AEJB_1XM_BI_BTOB (ID) !
-- =======================================================================
-- com.sun.ts.tests.ejb30.persistence.entitytest.cascadeall.manyXone
DROP TABLE AEJB_MX1_UNI_BTOB !
CREATE TABLE AEJB_MX1_UNI_BTOB (id VARCHAR(255) NOT NULL, name VARCHAR(255), value INTEGER, PRIMARY KEY (id)) !
DROP TABLE BEJB_MX1_UNI_BTOB !
CREATE TABLE BEJB_MX1_UNI_BTOB (id VARCHAR(255) NOT NULL, name VARCHAR(255), value INTEGER, FK_FOR_AEJB_MX1_UNI_BTOB VARCHAR(255), PRIMARY KEY (id)) !
CREATE INDEX I_BJMX1TB_A1 ON BEJB_MX1_UNI_BTOB (FK_FOR_AEJB_MX1_UNI_BTOB) !
-- ALTER TABLE BEJB_MX1_UNI_BTOB ADD CONSTRAINT FK_FOR_AEJB_MX1_UN FOREIGN KEY (FK_FOR_AEJB_MX1_UNI_BTOB) REFERENCES AEJB_MX1_UNI_BTOB (ID) !
-- =======================================================================
--
DROP TABLE PROJECT!
CREATE TABLE PROJECT (PROJID INT NOT NULL, NAME VARCHAR(25), BUDGET DECIMAL(18,0), CONSTRAINT PK_PROJECT PRIMARY KEY (PROJID))!
-- =======================================================================
-- DROP TABLE A_BIGINTEGER!
-- CREATE TABLE A_BIGINTEGER ( ID VARCHAR(255), NAME VARCHAR(255) , VALUE INT, BASICINTEGER INT, BASICSHORT SMALLINT, BASICBIGSHORT SMALLINT, BASICFLOAT FLOAT, BASICBIGFLOAT FLOAT, BASICLONG BIGINT, BASICBIGLONG BIGINT, BASICDOUBLE DOUBLE, BASICBIGDOUBLE DOUBLE, BASICCHAR CHAR, BASICCHARARRAY VARCHAR(448), BASICBIGCHARARRAY VARCHAR(448), BASICBYTEARRAY LONG VARCHAR FOR BIT DATA, BASICBIGBYTEARRAY LONG VARCHAR FOR BIT DATA, BASICBIGINTEGER DECIMAL(18,0) PRIMARY KEY NOT NULL, BASICBIGDECIMAL DECIMAL(18,0), BASICDATE DATE, BASICTIME TIME, BASICCALENDAR DATE, BASICTIMESTAMP TIMESTAMP )!
-- DROP TABLE A_BIGDECIMAL!
-- CREATE TABLE A_BIGDECIMAL ( ID VARCHAR(255), NAME VARCHAR(255) , VALUE INT, BASICINTEGER INT, BASICSHORT SMALLINT, BASICBIGSHORT SMALLINT, BASICFLOAT FLOAT, BASICBIGFLOAT FLOAT, BASICLONG BIGINT, BASICBIGLONG BIGINT, BASICDOUBLE DOUBLE, BASICBIGDOUBLE DOUBLE, BASICCHAR CHAR, BASICCHARARRAY VARCHAR(448), BASICBIGCHARARRAY VARCHAR(448), BASICBYTEARRAY LONG VARCHAR FOR BIT DATA, BASICBIGBYTEARRAY LONG VARCHAR FOR BIT DATA, BASICBIGINTEGER DECIMAL(18,0), BASICBIGDECIMAL DECIMAL(18,0) PRIMARY KEY NOT NULL, BASICDATE DATE, BASICTIME TIME, BASICCALENDAR DATE, BASICTIMESTAMP TIMESTAMP )!