Commit 376fd524 authored by Steven Murray's avatar Steven Murray
Browse files

Introduced our own UINT64TYPE into our SQL so that we are explicit about data size and sign

parent bdc03e2a
......@@ -94,6 +94,7 @@ add_custom_command (OUTPUT sqlite_catalogue_schema.sql mysql_catalogue_schema.sq
${CMAKE_CURRENT_SOURCE_DIR}/sqlite_catalogue_schema_header.sql
${CMAKE_CURRENT_SOURCE_DIR}/common_catalogue_schema.sql
${CMAKE_CURRENT_SOURCE_DIR}/sqlite_catalogue_schema_trailer.sql
| sed 's/UINT64TYPE/INTEGER/g'
| sed 's/NUMERIC\([^\)]*\)/INTEGER/g'
| sed 's/CHECKSUM_BLOB_TYPE/BLOB\(200\)/g'
> sqlite_catalogue_schema.sql
......@@ -101,6 +102,7 @@ add_custom_command (OUTPUT sqlite_catalogue_schema.sql mysql_catalogue_schema.sq
${CMAKE_CURRENT_SOURCE_DIR}/mysql_catalogue_schema_header.sql
${CMAKE_CURRENT_SOURCE_DIR}/common_catalogue_schema.sql
${CMAKE_CURRENT_SOURCE_DIR}/mysql_catalogue_schema_trailer.sql
| sed 's/UINT64TYPE/BIGINT UNSIGNED/g'
| sed 's/NUMERIC\([^\)]*\)/BIGINT UNSIGNED/g'
| sed 's/CHECKSUM_BLOB_TYPE/VARBINARY\(200\)/g'
> mysql_catalogue_schema.sql
......@@ -108,6 +110,7 @@ add_custom_command (OUTPUT sqlite_catalogue_schema.sql mysql_catalogue_schema.sq
${CMAKE_CURRENT_SOURCE_DIR}/oracle_catalogue_schema_header.sql
${CMAKE_CURRENT_SOURCE_DIR}/common_catalogue_schema.sql
${CMAKE_CURRENT_SOURCE_DIR}/oracle_catalogue_schema_trailer.sql
| sed 's/UINT64TYPE/NUMERIC(20, 0)/g'
| sed 's/VARCHAR/VARCHAR2/g'
| sed 's/CHECKSUM_BLOB_TYPE/RAW\(200\)/g'
> oracle_catalogue_schema.sql
......@@ -115,6 +118,7 @@ add_custom_command (OUTPUT sqlite_catalogue_schema.sql mysql_catalogue_schema.sq
${CMAKE_CURRENT_SOURCE_DIR}/postgres_catalogue_schema_header.sql
${CMAKE_CURRENT_SOURCE_DIR}/common_catalogue_schema.sql
${CMAKE_CURRENT_SOURCE_DIR}/postgres_catalogue_schema_trailer.sql
| sed 's/UINT64TYPE/NUMERIC(20, 0)/g'
| sed 's/CHECKSUM_BLOB_TYPE/BYTEA/g'
> postgres_catalogue_schema.sql
DEPENDS
......
CREATE TABLE CTA_CATALOGUE(
SCHEMA_VERSION_MAJOR NUMERIC(20, 0) CONSTRAINT CTA_CATALOGUE_SVM1_NN NOT NULL,
SCHEMA_VERSION_MINOR NUMERIC(20, 0) CONSTRAINT CTA_CATALOGUE_SVM2_NN NOT NULL
SCHEMA_VERSION_MAJOR UINT64TYPE CONSTRAINT CTA_CATALOGUE_SVM1_NN NOT NULL,
SCHEMA_VERSION_MINOR UINT64TYPE CONSTRAINT CTA_CATALOGUE_SVM2_NN NOT NULL
);
CREATE TABLE ADMIN_USER(
ADMIN_USER_NAME VARCHAR(100) CONSTRAINT ADMIN_USER_AUN_NN NOT NULL,
USER_COMMENT VARCHAR(1000) CONSTRAINT ADMIN_USER_UC_NN NOT NULL,
CREATION_LOG_USER_NAME VARCHAR(100) CONSTRAINT ADMIN_USER_CLUN_NN NOT NULL,
CREATION_LOG_HOST_NAME VARCHAR(100) CONSTRAINT ADMIN_USER_CLHN_NN NOT NULL,
CREATION_LOG_TIME NUMERIC(20, 0) CONSTRAINT ADMIN_USER_CLT_NN NOT NULL,
CREATION_LOG_TIME UINT64TYPE CONSTRAINT ADMIN_USER_CLT_NN NOT NULL,
LAST_UPDATE_USER_NAME VARCHAR(100) CONSTRAINT ADMIN_USER_LUUN_NN NOT NULL,
LAST_UPDATE_HOST_NAME VARCHAR(100) CONSTRAINT ADMIN_USER_LUHN_NN NOT NULL,
LAST_UPDATE_TIME NUMERIC(20, 0) CONSTRAINT ADMIN_USER_LUT_NN NOT NULL,
LAST_UPDATE_TIME UINT64TYPE CONSTRAINT ADMIN_USER_LUT_NN NOT NULL,
CONSTRAINT ADMIN_USER_PK PRIMARY KEY(ADMIN_USER_NAME)
);
CREATE TABLE STORAGE_CLASS(
STORAGE_CLASS_ID NUMERIC(20, 0) CONSTRAINT STORAGE_CLASS_SCI_NN NOT NULL,
STORAGE_CLASS_ID UINT64TYPE CONSTRAINT STORAGE_CLASS_SCI_NN NOT NULL,
DISK_INSTANCE_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_DIN_NN NOT NULL,
STORAGE_CLASS_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_SCN_NN NOT NULL,
NB_COPIES NUMERIC(20, 0) CONSTRAINT STORAGE_CLASS_NC_NN NOT NULL,
NB_COPIES UINT64TYPE CONSTRAINT STORAGE_CLASS_NC_NN NOT NULL,
USER_COMMENT VARCHAR(1000) CONSTRAINT STORAGE_CLASS_UC_NN NOT NULL,
CREATION_LOG_USER_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_CLUN_NN NOT NULL,
CREATION_LOG_HOST_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_CLHN_NN NOT NULL,
CREATION_LOG_TIME NUMERIC(20, 0) CONSTRAINT STORAGE_CLASS_CLT_NN NOT NULL,
CREATION_LOG_TIME UINT64TYPE CONSTRAINT STORAGE_CLASS_CLT_NN NOT NULL,
LAST_UPDATE_USER_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_LUUN_NN NOT NULL,
LAST_UPDATE_HOST_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_LUHN_NN NOT NULL,
LAST_UPDATE_TIME NUMERIC(20, 0) CONSTRAINT STORAGE_CLASS_LUT_NN NOT NULL,
LAST_UPDATE_TIME UINT64TYPE CONSTRAINT STORAGE_CLASS_LUT_NN NOT NULL,
CONSTRAINT STORAGE_CLASS_PK PRIMARY KEY(STORAGE_CLASS_ID),
CONSTRAINT STORAGE_CLASS_DIN_SCN_UN UNIQUE(DISK_INSTANCE_NAME, STORAGE_CLASS_NAME)
);
CREATE TABLE TAPE_POOL(
TAPE_POOL_NAME VARCHAR(100) CONSTRAINT TAPE_POOL_TPN_NN NOT NULL,
VO VARCHAR(100) CONSTRAINT TAPE_POOL_VO_NN NOT NULL,
NB_PARTIAL_TAPES NUMERIC(20, 0) CONSTRAINT TAPE_POOL_NPT_NN NOT NULL,
NB_PARTIAL_TAPES UINT64TYPE CONSTRAINT TAPE_POOL_NPT_NN NOT NULL,
IS_ENCRYPTED CHAR(1) CONSTRAINT TAPE_POOL_IE_NN NOT NULL,
SUPPLY VARCHAR(100),
USER_COMMENT VARCHAR(1000) CONSTRAINT TAPE_POOL_UC_NN NOT NULL,
CREATION_LOG_USER_NAME VARCHAR(100) CONSTRAINT TAPE_POOL_CLUN_NN NOT NULL,
CREATION_LOG_HOST_NAME VARCHAR(100) CONSTRAINT TAPE_POOL_CLHN_NN NOT NULL,
CREATION_LOG_TIME NUMERIC(20, 0) CONSTRAINT TAPE_POOL_CLT_NN NOT NULL,
CREATION_LOG_TIME UINT64TYPE CONSTRAINT TAPE_POOL_CLT_NN NOT NULL,
LAST_UPDATE_USER_NAME VARCHAR(100) CONSTRAINT TAPE_POOL_LUUN_NN NOT NULL,
LAST_UPDATE_HOST_NAME VARCHAR(100) CONSTRAINT TAPE_POOL_LUHN_NN NOT NULL,
LAST_UPDATE_TIME NUMERIC(20, 0) CONSTRAINT TAPE_POOL_LUT_NN NOT NULL,
LAST_UPDATE_TIME UINT64TYPE CONSTRAINT TAPE_POOL_LUT_NN NOT NULL,
CONSTRAINT TAPE_POOL_PK PRIMARY KEY(TAPE_POOL_NAME),
CONSTRAINT TAPE_POOL_IS_ENCRYPTED_BOOL_CK CHECK(IS_ENCRYPTED IN ('0', '1'))
);
CREATE TABLE ARCHIVE_ROUTE(
STORAGE_CLASS_ID NUMERIC(20, 0) CONSTRAINT ARCHIVE_ROUTE_SCI_NN NOT NULL,
COPY_NB NUMERIC(20, 0) CONSTRAINT ARCHIVE_ROUTE_CN_NN NOT NULL,
STORAGE_CLASS_ID UINT64TYPE CONSTRAINT ARCHIVE_ROUTE_SCI_NN NOT NULL,
COPY_NB UINT64TYPE CONSTRAINT ARCHIVE_ROUTE_CN_NN NOT NULL,
TAPE_POOL_NAME VARCHAR(100) CONSTRAINT ARCHIVE_ROUTE_TPN_NN NOT NULL,
USER_COMMENT VARCHAR(1000) CONSTRAINT ARCHIVE_ROUTE_UC_NN NOT NULL,
CREATION_LOG_USER_NAME VARCHAR(100) CONSTRAINT ARCHIVE_ROUTE_CLUN_NN NOT NULL,
CREATION_LOG_HOST_NAME VARCHAR(100) CONSTRAINT ARCHIVE_ROUTE_CLHN_NN NOT NULL,
CREATION_LOG_TIME NUMERIC(20, 0) CONSTRAINT ARCHIVE_ROUTE_CLT_NN NOT NULL,
CREATION_LOG_TIME UINT64TYPE CONSTRAINT ARCHIVE_ROUTE_CLT_NN NOT NULL,
LAST_UPDATE_USER_NAME VARCHAR(100) CONSTRAINT ARCHIVE_ROUTE_LUUN_NN NOT NULL,
LAST_UPDATE_HOST_NAME VARCHAR(100) CONSTRAINT ARCHIVE_ROUTE_LUHN_NN NOT NULL,
LAST_UPDATE_TIME NUMERIC(20, 0) CONSTRAINT ARCHIVE_ROUTE_LUT_NN NOT NULL,
LAST_UPDATE_TIME UINT64TYPE CONSTRAINT ARCHIVE_ROUTE_LUT_NN NOT NULL,
CONSTRAINT ARCHIVE_ROUTE_PK PRIMARY KEY(STORAGE_CLASS_ID, COPY_NB),
CONSTRAINT ARCHIVE_ROUTE_STORAGE_CLASS_FK FOREIGN KEY(STORAGE_CLASS_ID) REFERENCES STORAGE_CLASS(STORAGE_CLASS_ID),
CONSTRAINT ARCHIVE_ROUTE_TAPE_POOL_FK FOREIGN KEY(TAPE_POOL_NAME)
......@@ -67,10 +67,10 @@ CREATE TABLE LOGICAL_LIBRARY(
USER_COMMENT VARCHAR(1000) CONSTRAINT LOGICAL_LIBRARY_UC_NN NOT NULL,
CREATION_LOG_USER_NAME VARCHAR(100) CONSTRAINT LOGICAL_LIBRARY_CLUN_NN NOT NULL,
CREATION_LOG_HOST_NAME VARCHAR(100) CONSTRAINT LOGICAL_LIBRARY_CLHN_NN NOT NULL,
CREATION_LOG_TIME NUMERIC(20, 0) CONSTRAINT LOGICAL_LIBRARY_CLT_NN NOT NULL,
CREATION_LOG_TIME UINT64TYPE CONSTRAINT LOGICAL_LIBRARY_CLT_NN NOT NULL,
LAST_UPDATE_USER_NAME VARCHAR(100) CONSTRAINT LOGICAL_LIBRARY_LUUN_NN NOT NULL,
LAST_UPDATE_HOST_NAME VARCHAR(100) CONSTRAINT LOGICAL_LIBRARY_LUHN_NN NOT NULL,
LAST_UPDATE_TIME NUMERIC(20, 0) CONSTRAINT LOGICAL_LIBRARY_LUT_NN NOT NULL,
LAST_UPDATE_TIME UINT64TYPE CONSTRAINT LOGICAL_LIBRARY_LUT_NN NOT NULL,
CONSTRAINT LOGICAL_LIBRARY_PK PRIMARY KEY(LOGICAL_LIBRARY_NAME),
CONSTRAINT LOGICAL_LIBRARY_ID_BOOL_CK CHECK(IS_DISABLED IN ('0', '1'))
);
......@@ -81,28 +81,28 @@ CREATE TABLE TAPE(
LOGICAL_LIBRARY_NAME VARCHAR(100) CONSTRAINT TAPE_LLN_NN NOT NULL,
TAPE_POOL_NAME VARCHAR(100) CONSTRAINT TAPE_TPN_NN NOT NULL,
ENCRYPTION_KEY VARCHAR(100),
CAPACITY_IN_BYTES NUMERIC(20, 0) CONSTRAINT TAPE_CIB_NN NOT NULL,
DATA_IN_BYTES NUMERIC(20, 0) CONSTRAINT TAPE_DIB_NN NOT NULL,
LAST_FSEQ NUMERIC(20, 0) CONSTRAINT TAPE_LF_NN NOT NULL,
CAPACITY_IN_BYTES UINT64TYPE CONSTRAINT TAPE_CIB_NN NOT NULL,
DATA_IN_BYTES UINT64TYPE CONSTRAINT TAPE_DIB_NN NOT NULL,
LAST_FSEQ UINT64TYPE CONSTRAINT TAPE_LF_NN NOT NULL,
IS_DISABLED CHAR(1) CONSTRAINT TAPE_ID_NN NOT NULL,
IS_FULL CHAR(1) CONSTRAINT TAPE_IF_NN NOT NULL,
IS_READ_ONLY CHAR(1) CONSTRAINT TAPE_IRO_NN NOT NULL,
IS_FROM_CASTOR CHAR(1) CONSTRAINT TAPE_IFC_NN NOT NULL,
LABEL_DRIVE VARCHAR(100),
LABEL_TIME NUMERIC(20, 0),
LABEL_TIME UINT64TYPE ,
LAST_READ_DRIVE VARCHAR(100),
LAST_READ_TIME NUMERIC(20, 0),
LAST_READ_TIME UINT64TYPE ,
LAST_WRITE_DRIVE VARCHAR(100),
LAST_WRITE_TIME NUMERIC(20, 0),
READ_MOUNT_COUNT NUMERIC(20, 0) DEFAULT 0 CONSTRAINT TAPE_RMC_NN NOT NULL,
WRITE_MOUNT_COUNT NUMERIC(20, 0) DEFAULT 0 CONSTRAINT TAPE_WMC_NN NOT NULL,
LAST_WRITE_TIME UINT64TYPE ,
READ_MOUNT_COUNT UINT64TYPE DEFAULT 0 CONSTRAINT TAPE_RMC_NN NOT NULL,
WRITE_MOUNT_COUNT UINT64TYPE DEFAULT 0 CONSTRAINT TAPE_WMC_NN NOT NULL,
USER_COMMENT VARCHAR(1000) CONSTRAINT TAPE_UC_NN NOT NULL,
CREATION_LOG_USER_NAME VARCHAR(100) CONSTRAINT TAPE_CLUN_NN NOT NULL,
CREATION_LOG_HOST_NAME VARCHAR(100) CONSTRAINT TAPE_CLHN_NN NOT NULL,
CREATION_LOG_TIME NUMERIC(20, 0) CONSTRAINT TAPE_CLT_NN NOT NULL,
CREATION_LOG_TIME UINT64TYPE CONSTRAINT TAPE_CLT_NN NOT NULL,
LAST_UPDATE_USER_NAME VARCHAR(100) CONSTRAINT TAPE_LUUN_NN NOT NULL,
LAST_UPDATE_HOST_NAME VARCHAR(100) CONSTRAINT TAPE_LUHN_NN NOT NULL,
LAST_UPDATE_TIME NUMERIC(20, 0) CONSTRAINT TAPE_LUT_NN NOT NULL,
LAST_UPDATE_TIME UINT64TYPE CONSTRAINT TAPE_LUT_NN NOT NULL,
CONSTRAINT TAPE_PK PRIMARY KEY(VID),
CONSTRAINT TAPE_LOGICAL_LIBRARY_FK FOREIGN KEY(LOGICAL_LIBRARY_NAME)
REFERENCES LOGICAL_LIBRARY(LOGICAL_LIBRARY_NAME),
......@@ -116,18 +116,18 @@ CREATE TABLE TAPE(
CREATE INDEX TAPE_TAPE_POOL_NAME_IDX ON TAPE(TAPE_POOL_NAME);
CREATE TABLE MOUNT_POLICY(
MOUNT_POLICY_NAME VARCHAR(100) CONSTRAINT MOUNT_POLICY_MPN_NN NOT NULL,
ARCHIVE_PRIORITY NUMERIC(20, 0) CONSTRAINT MOUNT_POLICY_AP_NN NOT NULL,
ARCHIVE_MIN_REQUEST_AGE NUMERIC(20, 0) CONSTRAINT MOUNT_POLICY_AMRA_NN NOT NULL,
RETRIEVE_PRIORITY NUMERIC(20, 0) CONSTRAINT MOUNT_POLICY_RP_NN NOT NULL,
RETRIEVE_MIN_REQUEST_AGE NUMERIC(20, 0) CONSTRAINT MOUNT_POLICY_RMRA_NN NOT NULL,
MAX_DRIVES_ALLOWED NUMERIC(20, 0) CONSTRAINT MOUNT_POLICY_MDA_NN NOT NULL,
ARCHIVE_PRIORITY UINT64TYPE CONSTRAINT MOUNT_POLICY_AP_NN NOT NULL,
ARCHIVE_MIN_REQUEST_AGE UINT64TYPE CONSTRAINT MOUNT_POLICY_AMRA_NN NOT NULL,
RETRIEVE_PRIORITY UINT64TYPE CONSTRAINT MOUNT_POLICY_RP_NN NOT NULL,
RETRIEVE_MIN_REQUEST_AGE UINT64TYPE CONSTRAINT MOUNT_POLICY_RMRA_NN NOT NULL,
MAX_DRIVES_ALLOWED UINT64TYPE CONSTRAINT MOUNT_POLICY_MDA_NN NOT NULL,
USER_COMMENT VARCHAR(1000) CONSTRAINT MOUNT_POLICY_UC_NN NOT NULL,
CREATION_LOG_USER_NAME VARCHAR(100) CONSTRAINT MOUNT_POLICY_CLUN_NN NOT NULL,
CREATION_LOG_HOST_NAME VARCHAR(100) CONSTRAINT MOUNT_POLICY_CLHN_NN NOT NULL,
CREATION_LOG_TIME NUMERIC(20, 0) CONSTRAINT MOUNT_POLICY_CLT_NN NOT NULL,
CREATION_LOG_TIME UINT64TYPE CONSTRAINT MOUNT_POLICY_CLT_NN NOT NULL,
LAST_UPDATE_USER_NAME VARCHAR(100) CONSTRAINT MOUNT_POLICY_LUUN_NN NOT NULL,
LAST_UPDATE_HOST_NAME VARCHAR(100) CONSTRAINT MOUNT_POLICY_LUHN_NN NOT NULL,
LAST_UPDATE_TIME NUMERIC(20, 0) CONSTRAINT MOUNT_POLICY_LUT_NN NOT NULL,
LAST_UPDATE_TIME UINT64TYPE CONSTRAINT MOUNT_POLICY_LUT_NN NOT NULL,
CONSTRAINT MOUNT_POLICY_PK PRIMARY KEY(MOUNT_POLICY_NAME)
);
CREATE TABLE REQUESTER_MOUNT_RULE(
......@@ -137,10 +137,10 @@ CREATE TABLE REQUESTER_MOUNT_RULE(
USER_COMMENT VARCHAR(1000) CONSTRAINT RQSTER_RULE_UC_NN NOT NULL,
CREATION_LOG_USER_NAME VARCHAR(100) CONSTRAINT RQSTER_RULE_CLUN_NN NOT NULL,
CREATION_LOG_HOST_NAME VARCHAR(100) CONSTRAINT RQSTER_RULE_CLHN_NN NOT NULL,
CREATION_LOG_TIME NUMERIC(20, 0) CONSTRAINT RQSTER_RULE_CLT_NN NOT NULL,
CREATION_LOG_TIME UINT64TYPE CONSTRAINT RQSTER_RULE_CLT_NN NOT NULL,
LAST_UPDATE_USER_NAME VARCHAR(100) CONSTRAINT RQSTER_RULE_LUUN_NN NOT NULL,
LAST_UPDATE_HOST_NAME VARCHAR(100) CONSTRAINT RQSTER_RULE_LUHN_NN NOT NULL,
LAST_UPDATE_TIME NUMERIC(20, 0) CONSTRAINT RQSTER_RULE_LUT_NN NOT NULL,
LAST_UPDATE_TIME UINT64TYPE CONSTRAINT RQSTER_RULE_LUT_NN NOT NULL,
CONSTRAINT RQSTER_RULE_PK PRIMARY KEY(DISK_INSTANCE_NAME, REQUESTER_NAME),
CONSTRAINT RQSTER_RULE_MNT_PLC_FK FOREIGN KEY(MOUNT_POLICY_NAME)
REFERENCES MOUNT_POLICY(MOUNT_POLICY_NAME)
......@@ -152,27 +152,27 @@ CREATE TABLE REQUESTER_GROUP_MOUNT_RULE(
USER_COMMENT VARCHAR(1000) CONSTRAINT RQSTER_GRP_RULE_UC_NN NOT NULL,
CREATION_LOG_USER_NAME VARCHAR(100) CONSTRAINT RQSTER_GRP_RULE_CLUN_NN NOT NULL,
CREATION_LOG_HOST_NAME VARCHAR(100) CONSTRAINT RQSTER_GRP_RULE_CLHN_NN NOT NULL,
CREATION_LOG_TIME NUMERIC(20, 0) CONSTRAINT RQSTER_GRP_RULE_CLT_NN NOT NULL,
CREATION_LOG_TIME UINT64TYPE CONSTRAINT RQSTER_GRP_RULE_CLT_NN NOT NULL,
LAST_UPDATE_USER_NAME VARCHAR(100) CONSTRAINT RQSTER_GRP_RULE_LUUN_NN NOT NULL,
LAST_UPDATE_HOST_NAME VARCHAR(100) CONSTRAINT RQSTER_GRP_RULE_LUHN_NN NOT NULL,
LAST_UPDATE_TIME NUMERIC(20, 0) CONSTRAINT RQSTER_GRP_RULE_LUT_NN NOT NULL,
LAST_UPDATE_TIME UINT64TYPE CONSTRAINT RQSTER_GRP_RULE_LUT_NN NOT NULL,
CONSTRAINT RQSTER_GRP_RULE_PK PRIMARY KEY(DISK_INSTANCE_NAME, REQUESTER_GROUP_NAME),
CONSTRAINT RQSTER_GRP_RULE_MNT_PLC_FK FOREIGN KEY(MOUNT_POLICY_NAME)
REFERENCES MOUNT_POLICY(MOUNT_POLICY_NAME)
);
CREATE TABLE ARCHIVE_FILE(
ARCHIVE_FILE_ID NUMERIC(20, 0) CONSTRAINT ARCHIVE_FILE_AFI_NN NOT NULL,
ARCHIVE_FILE_ID UINT64TYPE CONSTRAINT ARCHIVE_FILE_AFI_NN NOT NULL,
DISK_INSTANCE_NAME VARCHAR(100) CONSTRAINT ARCHIVE_FILE_DIN_NN NOT NULL,
DISK_FILE_ID VARCHAR(100) CONSTRAINT ARCHIVE_FILE_DFI_NN NOT NULL,
DISK_FILE_PATH VARCHAR(2000) CONSTRAINT ARCHIVE_FILE_DFP_NN NOT NULL,
DISK_FILE_UID NUMERIC(20, 0) CONSTRAINT ARCHIVE_FILE_DFUID_NN NOT NULL,
DISK_FILE_GID NUMERIC(20, 0) CONSTRAINT ARCHIVE_FILE_DFGID_NN NOT NULL,
SIZE_IN_BYTES NUMERIC(20, 0) CONSTRAINT ARCHIVE_FILE_SIB_NN NOT NULL,
DISK_FILE_UID UINT64TYPE CONSTRAINT ARCHIVE_FILE_DFUID_NN NOT NULL,
DISK_FILE_GID UINT64TYPE CONSTRAINT ARCHIVE_FILE_DFGID_NN NOT NULL,
SIZE_IN_BYTES UINT64TYPE CONSTRAINT ARCHIVE_FILE_SIB_NN NOT NULL,
CHECKSUM_BLOB CHECKSUM_BLOB_TYPE,
CHECKSUM_ADLER32 NUMERIC(20, 0) CONSTRAINT ARCHIVE_FILE_CB2_NN NOT NULL,
STORAGE_CLASS_ID NUMERIC(20, 0) CONSTRAINT ARCHIVE_FILE_SCI_NN NOT NULL,
CREATION_TIME NUMERIC(20, 0) CONSTRAINT ARCHIVE_FILE_CT2_NN NOT NULL,
RECONCILIATION_TIME NUMERIC(20, 0) CONSTRAINT ARCHIVE_FILE_RT_NN NOT NULL,
CHECKSUM_ADLER32 UINT64TYPE CONSTRAINT ARCHIVE_FILE_CB2_NN NOT NULL,
STORAGE_CLASS_ID UINT64TYPE CONSTRAINT ARCHIVE_FILE_SCI_NN NOT NULL,
CREATION_TIME UINT64TYPE CONSTRAINT ARCHIVE_FILE_CT2_NN NOT NULL,
RECONCILIATION_TIME UINT64TYPE CONSTRAINT ARCHIVE_FILE_RT_NN NOT NULL,
CONSTRAINT ARCHIVE_FILE_PK PRIMARY KEY(ARCHIVE_FILE_ID),
CONSTRAINT ARCHIVE_FILE_STORAGE_CLASS_FK FOREIGN KEY(STORAGE_CLASS_ID) REFERENCES STORAGE_CLASS(STORAGE_CLASS_ID),
CONSTRAINT ARCHIVE_FILE_DIN_DFI_UN UNIQUE(DISK_INSTANCE_NAME, DISK_FILE_ID)
......@@ -180,14 +180,14 @@ CREATE TABLE ARCHIVE_FILE(
CREATE INDEX ARCHIVE_FILE_DIN_DFP_IDX ON ARCHIVE_FILE(DISK_INSTANCE_NAME, DISK_FILE_PATH);
CREATE TABLE TAPE_FILE(
VID VARCHAR(100) CONSTRAINT TAPE_FILE_V_NN NOT NULL,
FSEQ NUMERIC(20, 0) CONSTRAINT TAPE_FILE_F_NN NOT NULL,
BLOCK_ID NUMERIC(20, 0) CONSTRAINT TAPE_FILE_BI_NN NOT NULL,
LOGICAL_SIZE_IN_BYTES NUMERIC(20, 0) CONSTRAINT TAPE_FILE_CSIB_NN NOT NULL,
COPY_NB NUMERIC(20, 0) CONSTRAINT TAPE_FILE_CN_NN NOT NULL,
CREATION_TIME NUMERIC(20, 0) CONSTRAINT TAPE_FILE_CT_NN NOT NULL,
ARCHIVE_FILE_ID NUMERIC(20, 0) CONSTRAINT TAPE_FILE_AFI_NN NOT NULL,
FSEQ UINT64TYPE CONSTRAINT TAPE_FILE_F_NN NOT NULL,
BLOCK_ID UINT64TYPE CONSTRAINT TAPE_FILE_BI_NN NOT NULL,
LOGICAL_SIZE_IN_BYTES UINT64TYPE CONSTRAINT TAPE_FILE_CSIB_NN NOT NULL,
COPY_NB UINT64TYPE CONSTRAINT TAPE_FILE_CN_NN NOT NULL,
CREATION_TIME UINT64TYPE CONSTRAINT TAPE_FILE_CT_NN NOT NULL,
ARCHIVE_FILE_ID UINT64TYPE CONSTRAINT TAPE_FILE_AFI_NN NOT NULL,
SUPERSEDED_BY_VID VARCHAR(100),
SUPERSEDED_BY_FSEQ NUMERIC(20, 0),
SUPERSEDED_BY_FSEQ UINT64TYPE ,
CONSTRAINT TAPE_FILE_PK PRIMARY KEY(VID, FSEQ),
CONSTRAINT TAPE_FILE_TAPE_FK FOREIGN KEY(VID)
REFERENCES TAPE(VID),
......@@ -208,21 +208,21 @@ CREATE TABLE ACTIVITIES_WEIGHTS (
USER_COMMENT VARCHAR(1000) CONSTRAINT ACTIV_WEIGHTS_UC_NN NOT NULL,
CREATION_LOG_USER_NAME VARCHAR(100) CONSTRAINT ACTIV_WEIGHTS_CLUN_NN NOT NULL,
CREATION_LOG_HOST_NAME VARCHAR(100) CONSTRAINT ACTIV_WEIGHTS_CLHN_NN NOT NULL,
CREATION_LOG_TIME NUMERIC(20, 0) CONSTRAINT ACTIV_WEIGHTS_CLT_NN NOT NULL,
CREATION_LOG_TIME UINT64TYPE CONSTRAINT ACTIV_WEIGHTS_CLT_NN NOT NULL,
LAST_UPDATE_USER_NAME VARCHAR(100) CONSTRAINT ACTIV_WEIGHTS_LUUN_NN NOT NULL,
LAST_UPDATE_HOST_NAME VARCHAR(100) CONSTRAINT ACTIV_WEIGHTS_LUHN_NN NOT NULL,
LAST_UPDATE_TIME NUMERIC(20, 0) CONSTRAINT ACTIV_WEIGHTS_LUT_NN NOT NULL
LAST_UPDATE_TIME UINT64TYPE CONSTRAINT ACTIV_WEIGHTS_LUT_NN NOT NULL
);
CREATE TABLE USAGESTATS (
GID NUMERIC(6, 0) DEFAULT 0 CONSTRAINT NN_USAGESTATS_GID NOT NULL,
TIMESTAMP NUMERIC(20, 0) DEFAULT 0 CONSTRAINT NN_USAGESTATS_TS NOT NULL,
MAXFILEID NUMERIC(20, 0),
FILECOUNT NUMERIC(20, 0),
FILESIZE NUMERIC(20, 0),
SEGCOUNT NUMERIC(20, 0),
SEGSIZE NUMERIC(20, 0),
SEG2COUNT NUMERIC(20, 0),
SEG2SIZE NUMERIC(20, 0),
TIMESTAMP UINT64TYPE DEFAULT 0 CONSTRAINT NN_USAGESTATS_TS NOT NULL,
MAXFILEID UINT64TYPE ,
FILECOUNT UINT64TYPE ,
FILESIZE UINT64TYPE ,
SEGCOUNT UINT64TYPE ,
SEGSIZE UINT64TYPE ,
SEG2COUNT UINT64TYPE ,
SEG2SIZE UINT64TYPE ,
CONSTRAINT PK_USAGESTATS_GID_TS PRIMARY KEY (GID, TIMESTAMP)
);
CREATE TABLE EXPERIMENTS (
......
CREATE TABLE ARCHIVE_FILE_ID(
ID NUMERIC(20, 0),
ID UINT64TYPE,
CONSTRAINT ARCHIVE_FILE_ID_PK PRIMARY KEY(ID)
);
INSERT INTO ARCHIVE_FILE_ID(ID) VALUES(1);
CREATE TABLE STORAGE_CLASS_ID(
ID NUMERIC(20, 0),
ID UINT64TYPE,
CONSTRAINT STORAGE_CLASS_ID_PK PRIMARY KEY(ID)
);
INSERT INTO STORAGE_CLASS_ID(ID) VALUES(1);
......@@ -16,12 +16,12 @@ CREATE SEQUENCE STORAGE_CLASS_ID_SEQ
NOORDER;
CREATE GLOBAL TEMPORARY TABLE TEMP_TAPE_FILE_INSERTION_BATCH(
VID VARCHAR(100),
FSEQ NUMERIC(20, 0),
BLOCK_ID NUMERIC(20, 0),
LOGICAL_SIZE_IN_BYTES NUMERIC(20, 0),
COPY_NB NUMERIC(20, 0),
CREATION_TIME NUMERIC(20, 0),
ARCHIVE_FILE_ID NUMERIC(20, 0)
FSEQ UINT64TYPE ,
BLOCK_ID UINT64TYPE ,
LOGICAL_SIZE_IN_BYTES UINT64TYPE ,
COPY_NB UINT64TYPE ,
CREATION_TIME UINT64TYPE ,
ARCHIVE_FILE_ID UINT64TYPE
)
ON COMMIT DELETE ROWS;
CREATE INDEX TEMP_T_F_I_B_ARCHIVE_FILE_ID_I ON TEMP_TAPE_FILE_INSERTION_BATCH(ARCHIVE_FILE_ID);
......@@ -62,7 +62,7 @@ std::string cta_rdbms_StmtTest::getCreateStmtTestTableSql() {
std::string sql =
"CREATE TABLE STMT_TEST("
"DOUBLE_COL FLOAT,"
"UINT64_COL NUMERIC(20, 0),"
"UINT64_COL UINT64TYPE,"
"STRING_COL VARCHAR(100),"
"BOOL_COL CHAR(1)"
")";
......@@ -71,14 +71,17 @@ std::string cta_rdbms_StmtTest::getCreateStmtTestTableSql() {
case Login::DBTYPE_IN_MEMORY:
break;
case Login::DBTYPE_ORACLE:
utils::searchAndReplace(sql, "UINT64TYPE", "NUMERIC(20, 0)");
utils::searchAndReplace(sql, "VARCHAR", "VARCHAR2");
break;
case Login::DBTYPE_SQLITE:
utils::searchAndReplace(sql, "UINT64TYPE", "INTEGER");
break;
case Login::DBTYPE_MYSQL:
utils::searchAndReplace(sql, "NUMERIC(20, 0)", "BIGINT UNSIGNED");
utils::searchAndReplace(sql, "UINT64TYPE", "BIGINT UNSIGNED");
break;
case Login::DBTYPE_POSTGRESQL:
utils::searchAndReplace(sql, "UINT64TYPE", "NUMERIC(20, 0)");
break;
case Login::DBTYPE_NONE:
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment