Commit ac9cca06 authored by Cedric Caffy's avatar Cedric Caffy
Browse files

[migration] Added the new tape state-related columns to the migration scripts

parent 215d7bf0
......@@ -221,6 +221,7 @@ CREATE TABLE TAPE(
);
CREATE INDEX TAPE_TAPE_POOL_ID_IDX ON TAPE(TAPE_POOL_ID);
CREATE INDEX TAPE_IS_DISABLED_IDX ON TAPE(IS_DISABLED);
CREATE INDEX TAPE_STATE_IDX ON TAPE(TAPE_STATE);
CREATE TABLE MOUNT_POLICY(
MOUNT_POLICY_NAME VARCHAR(100) CONSTRAINT MOUNT_POLICY_MPN_NN NOT NULL,
ARCHIVE_PRIORITY BIGINT UNSIGNED CONSTRAINT MOUNT_POLICY_AP_NN NOT NULL,
......
......@@ -253,6 +253,7 @@ CREATE TABLE TAPE(
);
CREATE INDEX TAPE_TAPE_POOL_ID_IDX ON TAPE(TAPE_POOL_ID);
CREATE INDEX TAPE_IS_DISABLED_IDX ON TAPE(IS_DISABLED);
CREATE INDEX TAPE_STATE_IDX ON TAPE(TAPE_STATE);
CREATE TABLE MOUNT_POLICY(
MOUNT_POLICY_NAME VARCHAR2(100) CONSTRAINT MOUNT_POLICY_MPN_NN NOT NULL,
ARCHIVE_PRIORITY NUMERIC(20, 0) CONSTRAINT MOUNT_POLICY_AP_NN NOT NULL,
......
......@@ -235,6 +235,7 @@ CREATE TABLE TAPE(
);
CREATE INDEX TAPE_TAPE_POOL_ID_IDX ON TAPE(TAPE_POOL_ID);
CREATE INDEX TAPE_IS_DISABLED_IDX ON TAPE(IS_DISABLED);
CREATE INDEX TAPE_STATE_IDX ON TAPE(TAPE_STATE);
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,
......
......@@ -207,6 +207,7 @@ CREATE TABLE TAPE(
);
CREATE INDEX TAPE_TAPE_POOL_ID_IDX ON TAPE(TAPE_POOL_ID);
CREATE INDEX TAPE_IS_DISABLED_IDX ON TAPE(IS_DISABLED);
CREATE INDEX TAPE_STATE_IDX ON TAPE(TAPE_STATE);
CREATE TABLE MOUNT_POLICY(
MOUNT_POLICY_NAME VARCHAR(100) CONSTRAINT MOUNT_POLICY_MPN_NN NOT NULL,
ARCHIVE_PRIORITY INTEGER CONSTRAINT MOUNT_POLICY_AP_NN NOT NULL,
......
......@@ -7211,6 +7211,7 @@ namespace catalogue{
");"
"CREATE INDEX TAPE_TAPE_POOL_ID_IDX ON TAPE(TAPE_POOL_ID);"
"CREATE INDEX TAPE_IS_DISABLED_IDX ON TAPE(IS_DISABLED);"
"CREATE INDEX TAPE_STATE_IDX ON TAPE(TAPE_STATE);"
"CREATE TABLE MOUNT_POLICY("
" MOUNT_POLICY_NAME VARCHAR2(100) CONSTRAINT MOUNT_POLICY_MPN_NN NOT NULL,"
" ARCHIVE_PRIORITY NUMERIC(20, 0) CONSTRAINT MOUNT_POLICY_AP_NN NOT NULL,"
......@@ -7632,6 +7633,7 @@ namespace catalogue{
");"
"CREATE INDEX TAPE_TAPE_POOL_ID_IDX ON TAPE(TAPE_POOL_ID);"
"CREATE INDEX TAPE_IS_DISABLED_IDX ON TAPE(IS_DISABLED);"
"CREATE INDEX TAPE_STATE_IDX ON TAPE(TAPE_STATE);"
"CREATE TABLE MOUNT_POLICY("
" MOUNT_POLICY_NAME VARCHAR(100) CONSTRAINT MOUNT_POLICY_MPN_NN NOT NULL,"
" ARCHIVE_PRIORITY BIGINT UNSIGNED CONSTRAINT MOUNT_POLICY_AP_NN NOT NULL,"
......@@ -8038,6 +8040,7 @@ namespace catalogue{
");"
"CREATE INDEX TAPE_TAPE_POOL_ID_IDX ON TAPE(TAPE_POOL_ID);"
"CREATE INDEX TAPE_IS_DISABLED_IDX ON TAPE(IS_DISABLED);"
"CREATE INDEX TAPE_STATE_IDX ON TAPE(TAPE_STATE);"
"CREATE TABLE MOUNT_POLICY("
" MOUNT_POLICY_NAME VARCHAR(100) CONSTRAINT MOUNT_POLICY_MPN_NN NOT NULL,"
" ARCHIVE_PRIORITY INTEGER CONSTRAINT MOUNT_POLICY_AP_NN NOT NULL,"
......@@ -8470,6 +8473,7 @@ namespace catalogue{
");"
"CREATE INDEX TAPE_TAPE_POOL_ID_IDX ON TAPE(TAPE_POOL_ID);"
"CREATE INDEX TAPE_IS_DISABLED_IDX ON TAPE(IS_DISABLED);"
"CREATE INDEX TAPE_STATE_IDX ON TAPE(TAPE_STATE);"
"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,"
......
......@@ -186,6 +186,7 @@ CREATE TABLE TAPE(
);
CREATE INDEX TAPE_TAPE_POOL_ID_IDX ON TAPE(TAPE_POOL_ID);
CREATE INDEX TAPE_IS_DISABLED_IDX ON TAPE(IS_DISABLED);
CREATE INDEX TAPE_STATE_IDX ON TAPE(TAPE_STATE);
CREATE TABLE MOUNT_POLICY(
MOUNT_POLICY_NAME VARCHAR(100) CONSTRAINT MOUNT_POLICY_MPN_NN NOT NULL,
ARCHIVE_PRIORITY UINT64TYPE CONSTRAINT MOUNT_POLICY_AP_NN NOT NULL,
......
......@@ -181,13 +181,29 @@ DELETE FROM TAPE_FILE_RECYCLE_BIN;
--precondition-sql-check expectedResult:"1" SELECT COUNT(*) FROM CTA_CATALOGUE WHERE SCHEMA_VERSION_MAJOR = 3 AND (SCHEMA_VERSION_MINOR = 1 OR SCHEMA_VERSION_MINOR = 2);
DELETE FROM ARCHIVE_FILE_RECYCLE_BIN;
--changeset ccaffy:10 failOnError:true dbms:oracle
--changeset ccaffy:11 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"3.1" 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 ADD (
TAPE_STATE VARCHAR2(100),
STATE_REASON VARCHAR2(1000),
STATE_UPDATE_TIME NUMERIC(20, 0),
STATE_MODIFIED_BY VARCHAR2(100),
CONSTRAINT TAPE_STATE_CK CHECK(TAPE_STATE IN ('ACTIVE', 'DISABLED', 'BROKEN'))
);
--changeset ccaffy:12 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"3.1" 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 TAPE_STATE_IDX ON TAPE(TAPE_STATE);
--changeset ccaffy:13 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"3.1" 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_ARCHIVED;
ALTER TABLE TAPE DROP COLUMN IS_EXPORTED;
--changeset ccaffy:11 failOnError:true dbms:oracle
--changeset ccaffy:14 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"3.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 STATUS='PRODUCTION';
......
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