diff --git a/catalogue/1.1/mysql_catalogue_schema.sql b/catalogue/1.1/mysql_catalogue_schema.sql index 1b308e9b6c62e84441a653cb7494941a992955b7..6e349a23a7292457759afa511b834467d1a38a9b 100644 --- a/catalogue/1.1/mysql_catalogue_schema.sql +++ b/catalogue/1.1/mysql_catalogue_schema.sql @@ -227,6 +227,7 @@ CREATE TABLE ARCHIVE_FILE( CONSTRAINT ARCHIVE_FILE_ID_BOOL_CK CHECK(IS_DELETED IN ('0', '1')) ); CREATE INDEX ARCHIVE_FILE_DIN_DFP_IDX ON ARCHIVE_FILE(DISK_INSTANCE_NAME, DISK_FILE_PATH); +CREATE INDEX ARCHIVE_FILE_DFI_IDX ON ARCHIVE_FILE(DISK_FILE_ID); CREATE TABLE TAPE_FILE( VID VARCHAR(100) CONSTRAINT TAPE_FILE_V_NN NOT NULL, FSEQ BIGINT UNSIGNED CONSTRAINT TAPE_FILE_F_NN NOT NULL, diff --git a/catalogue/1.1/oracle_catalogue_schema.sql b/catalogue/1.1/oracle_catalogue_schema.sql index 3cdc5b282342c0d4f346267c730a5bd6743d1902..d4fad39fe9a1e4ca77670d46682db429007f42f4 100644 --- a/catalogue/1.1/oracle_catalogue_schema.sql +++ b/catalogue/1.1/oracle_catalogue_schema.sql @@ -249,6 +249,7 @@ CREATE TABLE ARCHIVE_FILE( CONSTRAINT ARCHIVE_FILE_ID_BOOL_CK CHECK(IS_DELETED IN ('0', '1')) ); CREATE INDEX ARCHIVE_FILE_DIN_DFP_IDX ON ARCHIVE_FILE(DISK_INSTANCE_NAME, DISK_FILE_PATH); +CREATE INDEX ARCHIVE_FILE_DFI_IDX ON ARCHIVE_FILE(DISK_FILE_ID); CREATE TABLE TAPE_FILE( VID VARCHAR2(100) CONSTRAINT TAPE_FILE_V_NN NOT NULL, FSEQ NUMERIC(20, 0) CONSTRAINT TAPE_FILE_F_NN NOT NULL, diff --git a/catalogue/1.1/postgres_catalogue_schema.sql b/catalogue/1.1/postgres_catalogue_schema.sql index b27719df47724c3c75ec9fd6728d735c6de3a711..8afaa5ed841545d41d611e5535382c8400eded90 100644 --- a/catalogue/1.1/postgres_catalogue_schema.sql +++ b/catalogue/1.1/postgres_catalogue_schema.sql @@ -234,6 +234,7 @@ CREATE TABLE ARCHIVE_FILE( CONSTRAINT ARCHIVE_FILE_ID_BOOL_CK CHECK(IS_DELETED IN ('0', '1')) ); CREATE INDEX ARCHIVE_FILE_DIN_DFP_IDX ON ARCHIVE_FILE(DISK_INSTANCE_NAME, DISK_FILE_PATH); +CREATE INDEX ARCHIVE_FILE_DFI_IDX ON ARCHIVE_FILE(DISK_FILE_ID); 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, diff --git a/catalogue/1.1/sqlite_catalogue_schema.sql b/catalogue/1.1/sqlite_catalogue_schema.sql index 820520416257f1d6633eae7fdc9d3fc1f9518f59..c6de9282321afd3a3ccc4b95da4e60277585e398 100644 --- a/catalogue/1.1/sqlite_catalogue_schema.sql +++ b/catalogue/1.1/sqlite_catalogue_schema.sql @@ -218,6 +218,7 @@ CREATE TABLE ARCHIVE_FILE( CONSTRAINT ARCHIVE_FILE_ID_BOOL_CK CHECK(IS_DELETED IN ('0', '1')) ); CREATE INDEX ARCHIVE_FILE_DIN_DFP_IDX ON ARCHIVE_FILE(DISK_INSTANCE_NAME, DISK_FILE_PATH); +CREATE INDEX ARCHIVE_FILE_DFI_IDX ON ARCHIVE_FILE(DISK_FILE_ID); CREATE TABLE TAPE_FILE( VID VARCHAR(100) CONSTRAINT TAPE_FILE_V_NN NOT NULL, FSEQ INTEGER CONSTRAINT TAPE_FILE_F_NN NOT NULL, diff --git a/catalogue/AllCatalogueSchema.hpp b/catalogue/AllCatalogueSchema.hpp index 51f560dd3406b4d1473c93b03d1ad8cca3b4a9ec..7a6da26ab1014ac6464cb5f05058b92e0ad5774e 100644 --- a/catalogue/AllCatalogueSchema.hpp +++ b/catalogue/AllCatalogueSchema.hpp @@ -1474,6 +1474,7 @@ namespace catalogue{ " CONSTRAINT ARCHIVE_FILE_ID_BOOL_CK CHECK(IS_DELETED IN ('0', '1'))" ");" "CREATE INDEX ARCHIVE_FILE_DIN_DFP_IDX ON ARCHIVE_FILE(DISK_INSTANCE_NAME, DISK_FILE_PATH);" + "CREATE INDEX ARCHIVE_FILE_DFI_IDX ON ARCHIVE_FILE(DISK_FILE_ID);" "CREATE TABLE TAPE_FILE(" " VID VARCHAR2(100) CONSTRAINT TAPE_FILE_V_NN NOT NULL," " FSEQ NUMERIC(20, 0) CONSTRAINT TAPE_FILE_F_NN NOT NULL," @@ -1774,6 +1775,7 @@ namespace catalogue{ " CONSTRAINT ARCHIVE_FILE_ID_BOOL_CK CHECK(IS_DELETED IN ('0', '1'))" ");" "CREATE INDEX ARCHIVE_FILE_DIN_DFP_IDX ON ARCHIVE_FILE(DISK_INSTANCE_NAME, DISK_FILE_PATH);" + "CREATE INDEX ARCHIVE_FILE_DFI_IDX ON ARCHIVE_FILE(DISK_FILE_ID);" "CREATE TABLE TAPE_FILE(" " VID VARCHAR(100) CONSTRAINT TAPE_FILE_V_NN NOT NULL," " FSEQ BIGINT UNSIGNED CONSTRAINT TAPE_FILE_F_NN NOT NULL," @@ -2064,6 +2066,7 @@ namespace catalogue{ " CONSTRAINT ARCHIVE_FILE_ID_BOOL_CK CHECK(IS_DELETED IN ('0', '1'))" ");" "CREATE INDEX ARCHIVE_FILE_DIN_DFP_IDX ON ARCHIVE_FILE(DISK_INSTANCE_NAME, DISK_FILE_PATH);" + "CREATE INDEX ARCHIVE_FILE_DFI_IDX ON ARCHIVE_FILE(DISK_FILE_ID);" "CREATE TABLE TAPE_FILE(" " VID VARCHAR(100) CONSTRAINT TAPE_FILE_V_NN NOT NULL," " FSEQ INTEGER CONSTRAINT TAPE_FILE_F_NN NOT NULL," @@ -2368,6 +2371,7 @@ namespace catalogue{ " CONSTRAINT ARCHIVE_FILE_ID_BOOL_CK CHECK(IS_DELETED IN ('0', '1'))" ");" "CREATE INDEX ARCHIVE_FILE_DIN_DFP_IDX ON ARCHIVE_FILE(DISK_INSTANCE_NAME, DISK_FILE_PATH);" + "CREATE INDEX ARCHIVE_FILE_DFI_IDX ON ARCHIVE_FILE(DISK_FILE_ID);" "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," diff --git a/catalogue/common_catalogue_schema.sql b/catalogue/common_catalogue_schema.sql index e53299c994469ded4c6ec8884e209e386fb89acd..838f4efdee18106f011b20865797d22cfbda44d9 100644 --- a/catalogue/common_catalogue_schema.sql +++ b/catalogue/common_catalogue_schema.sql @@ -206,6 +206,7 @@ CREATE TABLE ARCHIVE_FILE( CONSTRAINT ARCHIVE_FILE_ID_BOOL_CK CHECK(IS_DELETED IN ('0', '1')) ); CREATE INDEX ARCHIVE_FILE_DIN_DFP_IDX ON ARCHIVE_FILE(DISK_INSTANCE_NAME, DISK_FILE_PATH); +CREATE INDEX ARCHIVE_FILE_DFI_IDX ON ARCHIVE_FILE(DISK_FILE_ID); CREATE TABLE TAPE_FILE( VID VARCHAR(100) CONSTRAINT TAPE_FILE_V_NN NOT NULL, FSEQ UINT64TYPE CONSTRAINT TAPE_FILE_F_NN NOT NULL, diff --git a/catalogue/migrations/liquibase/oracle/1.0to1.1.sql b/catalogue/migrations/liquibase/oracle/1.0to1.1.sql index a6bd689d71ec0b2367e0e6cd76304d23bb72bb17..bdddfdd9aa7afa6dab2a5849ac15cae498234142 100644 --- a/catalogue/migrations/liquibase/oracle/1.0to1.1.sql +++ b/catalogue/migrations/liquibase/oracle/1.0to1.1.sql @@ -83,10 +83,16 @@ ALTER TABLE LOGICAL_LIBRARY RENAME CONSTRAINT LOGICAL_LIBRARY_LLN TO LOGICAL_LIB --changeset ccaffy:12 failOnError:true dbms:oracle --preconditions onFail:HALT onError:HALT --precondition-sql-check expectedResult:"1.0" SELECT CONCAT(CONCAT(CAST(SCHEMA_VERSION_MAJOR as VARCHAR(10)),'.'), CAST(SCHEMA_VERSION_MINOR AS VARCHAR(10))) AS CATALOGUE_VERSION FROM CTA_CATALOGUE; +CREATE INDEX ARCHIVE_FILE_DFI_IDX ON ARCHIVE_FILE(DISK_FILE_ID); +--rollback DROP INDEX ARCHIVE_FILE_DFI_IDX; + +--changeset ccaffy:13 failOnError:true dbms:oracle +--preconditions onFail:HALT onError:HALT +--precondition-sql-check expectedResult:"1.0" SELECT CONCAT(CONCAT(CAST(SCHEMA_VERSION_MAJOR as VARCHAR(10)),'.'), CAST(SCHEMA_VERSION_MINOR AS VARCHAR(10))) AS CATALOGUE_VERSION FROM CTA_CATALOGUE; UPDATE CTA_CATALOGUE SET SCHEMA_VERSION_MINOR=1; --rollback UPDATE CTA_CATALOGUE SET SCHEMA_VERSION_MINOR=0 ---changeset ccaffy:13 failOnError:true dbms:oracle +--changeset ccaffy:14 failOnError:true dbms:oracle --preconditions onFail:HALT onError:HALT --precondition-sql-check expectedResult:"1.1" SELECT CONCAT(CONCAT(CAST(SCHEMA_VERSION_MAJOR as VARCHAR(10)),'.'), CAST(SCHEMA_VERSION_MINOR AS VARCHAR(10))) AS CATALOGUE_VERSION FROM CTA_CATALOGUE; UPDATE CTA_CATALOGUE SET NEXT_SCHEMA_VERSION_MAJOR=NULL;