Commit 0a358b82 authored by Cedric Caffy's avatar Cedric Caffy
Browse files

Modified the 3.2to4.0.sql file to make the DROP columns faster

parent dc723c91
Pipeline #3037 passed with stages
in 17 minutes and 4 seconds
......@@ -25,32 +25,26 @@ DROP INDEX TAPE_FILE_SBV_SBF_IDX;
--changeset ccaffy:4 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"3.2" SELECT CONCAT(CONCAT(CAST(SCHEMA_VERSION_MAJOR as VARCHAR(10)),'.'), CAST(SCHEMA_VERSION_MINOR AS VARCHAR(10))) AS CATALOGUE_VERSION FROM CTA_CATALOGUE;
ALTER TABLE TAPE_FILE DROP COLUMN SUPERSEDED_BY_VID;
ALTER TABLE TAPE_FILE DROP COLUMN SUPERSEDED_BY_FSEQ;
ALTER TABLE TAPE_FILE DROP COLUMN WRITE_START_WRAP;
ALTER TABLE TAPE_FILE DROP COLUMN WRITE_START_LPOS;
ALTER TABLE TAPE_FILE DROP COLUMN WRITE_END_WRAP;
ALTER TABLE TAPE_FILE DROP COLUMN WRITE_END_LPOS;
ALTER TABLE TAPE_FILE DROP COLUMN READ_START_WRAP;
ALTER TABLE TAPE_FILE DROP COLUMN READ_START_LPOS;
ALTER TABLE TAPE_FILE DROP COLUMN READ_END_WRAP;
ALTER TABLE TAPE_FILE DROP COLUMN READ_END_LPOS;
--rollback ALTER TABLE TAPE_FILE ADD (
--rollback SUPERSEDED_BY_VID VARCHAR2(100),
--rollback SUPERSEDED_BY_FSEQ NUMERIC(20, 0),
--rollback WRITE_START_WRAP NUMERIC(5, 0),
--rollback WRITE_START_LPOS NUMERIC(10, 0),
--rollback WRITE_END_WRAP NUMERIC(5, 0),
--rollback WRITE_END_LPOS NUMERIC(10, 0),
--rollback READ_START_WRAP NUMERIC(5, 0),
--rollback READ_START_LPOS NUMERIC(10, 0),
--rollback READ_END_WRAP NUMERIC(5, 0),
--rollback READ_END_LPOS NUMERIC(10, 0)
--rollback );
ALTER TABLE TAPE_FILE SET UNUSED (
SUPERSEDED_BY_VID,
SUPERSEDED_BY_FSEQ,
WRITE_START_WRAP,
WRITE_START_LPOS,
WRITE_END_WRAP,
WRITE_END_LPOS,
READ_START_WRAP,
READ_START_LPOS,
READ_END_WRAP,
READ_END_LPOS);
--changeset ccaffy:5 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"3.2" SELECT CONCAT(CONCAT(CAST(SCHEMA_VERSION_MAJOR as VARCHAR(10)),'.'), CAST(SCHEMA_VERSION_MINOR AS VARCHAR(10))) AS CATALOGUE_VERSION FROM CTA_CATALOGUE;
ALTER TABLE TAPE_FILE DROP UNUSED COLUMNS CHECKPOINT 2500;
--changeset ccaffy:6 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"3.2" SELECT CONCAT(CONCAT(CAST(SCHEMA_VERSION_MAJOR as VARCHAR(10)),'.'), CAST(SCHEMA_VERSION_MINOR AS VARCHAR(10))) AS CATALOGUE_VERSION FROM CTA_CATALOGUE;
DROP TABLE TAPE_FILE_RECYCLE_BIN;
--rollback CREATE TABLE TAPE_FILE_RECYCLE_BIN(
--rollback VID VARCHAR2(100) CONSTRAINT TAPE_FILE_RB_V_NN NOT NULL,
......@@ -81,7 +75,7 @@ DROP TABLE TAPE_FILE_RECYCLE_BIN;
--rollback REFERENCES TAPE_FILE_RECYCLE_BIN(VID, FSEQ)
--rollback );
--changeset ccaffy:6 failOnError:true dbms:oracle
--changeset ccaffy:7 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"3.2" SELECT CONCAT(CONCAT(CAST(SCHEMA_VERSION_MAJOR as VARCHAR(10)),'.'), CAST(SCHEMA_VERSION_MINOR AS VARCHAR(10))) AS CATALOGUE_VERSION FROM CTA_CATALOGUE;
DROP TABLE ARCHIVE_FILE_RECYCLE_BIN;
......@@ -106,67 +100,72 @@ DROP TABLE ARCHIVE_FILE_RECYCLE_BIN;
--rollback CONSTRAINT ARCHIVE_FILE_RB_DIN_DFI_UN UNIQUE(DISK_INSTANCE_NAME, DISK_FILE_ID)
--rollback );
--changeset ccaffy:7 failOnError:true dbms:oracle
--changeset ccaffy:8 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"3.2" SELECT CONCAT(CONCAT(CAST(SCHEMA_VERSION_MAJOR as VARCHAR(10)),'.'), CAST(SCHEMA_VERSION_MINOR AS VARCHAR(10))) AS CATALOGUE_VERSION FROM CTA_CATALOGUE;
ALTER TABLE TAPE MODIFY TAPE_STATE VARCHAR2(100) CONSTRAINT TAPE_TS_NN NOT NULL;
--rollback ALTER TABLE TAPE DROP CONSTRAINT TAPE_TS_NN;
--changeset ccaffy:8 failOnError:true dbms:oracle
--changeset ccaffy:9 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"3.2" SELECT CONCAT(CONCAT(CAST(SCHEMA_VERSION_MAJOR as VARCHAR(10)),'.'), CAST(SCHEMA_VERSION_MINOR AS VARCHAR(10))) AS CATALOGUE_VERSION FROM CTA_CATALOGUE;
ALTER TABLE TAPE MODIFY STATE_UPDATE_TIME NUMERIC(20,0) CONSTRAINT TAPE_SUT_NN NOT NULL;
--rollback ALTER TABLE TAPE DROP CONSTRAINT TAPE_SUT_NN;
--changeset ccaffy:9 failOnError:true dbms:oracle
--changeset ccaffy:10 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"3.2" SELECT CONCAT(CONCAT(CAST(SCHEMA_VERSION_MAJOR as VARCHAR(10)),'.'), CAST(SCHEMA_VERSION_MINOR AS VARCHAR(10))) AS CATALOGUE_VERSION FROM CTA_CATALOGUE;
ALTER TABLE TAPE MODIFY STATE_MODIFIED_BY VARCHAR2(100) CONSTRAINT TAPE_SMB_NN NOT NULL;
--rollback ALTER TABLE TAPE DROP CONSTRAINT TAPE_SMB_NN;
--changeset ccaffy:10 failOnError:true dbms:oracle
--changeset ccaffy:11 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"3.2" SELECT CONCAT(CONCAT(CAST(SCHEMA_VERSION_MAJOR as VARCHAR(10)),'.'), CAST(SCHEMA_VERSION_MINOR AS VARCHAR(10))) AS CATALOGUE_VERSION FROM CTA_CATALOGUE;
ALTER TABLE TAPE DROP CONSTRAINT TAPE_IS_DISABLED_BOOL_CK;
--rollback ALTER TABLE TAPE ADD CONSTRAINT TAPE_IS_DISABLED_BOOL_CK CHECK(IS_DISABLED IN ('0', '1'));
--changeset ccaffy:11 failOnError:true dbms:oracle
--changeset ccaffy:12 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"3.2" SELECT CONCAT(CONCAT(CAST(SCHEMA_VERSION_MAJOR as VARCHAR(10)),'.'), CAST(SCHEMA_VERSION_MINOR AS VARCHAR(10))) AS CATALOGUE_VERSION FROM CTA_CATALOGUE;
DROP INDEX TAPE_IS_DISABLED_IDX;
--rollback CREATE INDEX TAPE_IS_DISABLED_IDX ON TAPE(IS_DISABLED);
--changeset ccaffy:12 failOnError:true dbms:oracle
--changeset ccaffy:13 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"3.2" SELECT CONCAT(CONCAT(CAST(SCHEMA_VERSION_MAJOR as VARCHAR(10)),'.'), CAST(SCHEMA_VERSION_MINOR AS VARCHAR(10))) AS CATALOGUE_VERSION FROM CTA_CATALOGUE;
ALTER TABLE TAPE DROP COLUMN IS_DISABLED;
ALTER TABLE TAPE SET UNUSED(IS_DISABLED);
--changeset ccaffy:13 failOnError:true dbms:oracle
--changeset ccaffy:14 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"3.2" SELECT CONCAT(CONCAT(CAST(SCHEMA_VERSION_MAJOR as VARCHAR(10)),'.'), CAST(SCHEMA_VERSION_MINOR AS VARCHAR(10))) AS CATALOGUE_VERSION FROM CTA_CATALOGUE;
ALTER TABLE TAPE DROP CONSTRAINT TAPE_IS_READ_ONLY_BOOL_CK;
--changeset ccaffy:14 failOnError:true dbms:oracle
--changeset ccaffy:15 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"3.2" SELECT CONCAT(CONCAT(CAST(SCHEMA_VERSION_MAJOR as VARCHAR(10)),'.'), CAST(SCHEMA_VERSION_MINOR AS VARCHAR(10))) AS CATALOGUE_VERSION FROM CTA_CATALOGUE;
ALTER TABLE TAPE DROP COLUMN IS_READ_ONLY;
ALTER TABLE TAPE SET UNUSED(IS_READ_ONLY);
--changeset ccaffy:15 failOnError:true dbms:oracle
--changeset ccaffy:16 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"3.2" SELECT CONCAT(CONCAT(CAST(SCHEMA_VERSION_MAJOR as VARCHAR(10)),'.'), CAST(SCHEMA_VERSION_MINOR AS VARCHAR(10))) AS CATALOGUE_VERSION FROM CTA_CATALOGUE;
ALTER TABLE TAPE DROP UNUSED COLUMNS CHECKPOINT 2500;
--changeset ccaffy:17 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"3.2" SELECT CONCAT(CONCAT(CAST(SCHEMA_VERSION_MAJOR as VARCHAR(10)),'.'), CAST(SCHEMA_VERSION_MINOR AS VARCHAR(10))) AS CATALOGUE_VERSION FROM CTA_CATALOGUE;
ALTER TABLE VIRTUAL_ORGANIZATION MODIFY READ_MAX_DRIVES NUMERIC(20,0) CONSTRAINT VIRTUAL_ORGANIZATION_RMD_NN NOT NULL;
--changeset ccaffy:16 failOnError:true dbms:oracle
--changeset ccaffy:18 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"3.2" SELECT CONCAT(CONCAT(CAST(SCHEMA_VERSION_MAJOR as VARCHAR(10)),'.'), CAST(SCHEMA_VERSION_MINOR AS VARCHAR(10))) AS CATALOGUE_VERSION FROM CTA_CATALOGUE;
ALTER TABLE VIRTUAL_ORGANIZATION MODIFY WRITE_MAX_DRIVES NUMERIC(20,0) CONSTRAINT VIRTUAL_ORGANIZATION_WMD_NN NOT NULL;
--changeset ccaffy:17 failOnError:true dbms:oracle
--changeset ccaffy:19 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"3.2" SELECT CONCAT(CONCAT(CAST(SCHEMA_VERSION_MAJOR as VARCHAR(10)),'.'), CAST(SCHEMA_VERSION_MINOR AS VARCHAR(10))) AS CATALOGUE_VERSION FROM CTA_CATALOGUE;
ALTER TABLE MOUNT_POLICY DROP COLUMN MAX_DRIVES_ALLOWED;
--changeset ccaffy:18 failOnError:true dbms:oracle
--changeset ccaffy:20 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"3.2" 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 STATUS='PRODUCTION';
......
Markdown is supported
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