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

[catalogue] Schema v4.0, per-VO read/write max drives modifications

- ADD NOT NULL CONSTRAINT TO VIRTUAL_ORGANIZATION.READ_MAX_DRIVES
- ADD NOT NULL CONSTRAINT TO VIRTUAL_ORGANIZATION.WRITE_MAX_DRIVES
- removed the MOUNT_POLICY.MAX_DRIVES_ALLOWED column
- Migration scripts
parent 1902d5d1
......@@ -72,8 +72,8 @@ CREATE TABLE DISK_SYSTEM(
CREATE TABLE VIRTUAL_ORGANIZATION(
VIRTUAL_ORGANIZATION_ID BIGINT UNSIGNED CONSTRAINT VIRTUAL_ORGANIZATION_VOI_NN NOT NULL,
VIRTUAL_ORGANIZATION_NAME VARCHAR(100) CONSTRAINT VIRTUAL_ORGANIZATION_VON_NN NOT NULL,
READ_MAX_DRIVES BIGINT UNSIGNED,
WRITE_MAX_DRIVES BIGINT UNSIGNED,
READ_MAX_DRIVES BIGINT UNSIGNED CONSTRAINT VIRTUAL_ORGANIZATION_RMD_NN NOT NULL,
WRITE_MAX_DRIVES BIGINT UNSIGNED CONSTRAINT VIRTUAL_ORGANIZATION_WMD_NN NOT NULL,
USER_COMMENT VARCHAR(1000) CONSTRAINT VIRTUAL_ORGANIZATION_UC_NN NOT NULL,
CREATION_LOG_USER_NAME VARCHAR(100) CONSTRAINT VIRTUAL_ORGANIZATION_CLUN_NN NOT NULL,
CREATION_LOG_HOST_NAME VARCHAR(100) CONSTRAINT VIRTUAL_ORGANIZATION_CLHN_NN NOT NULL,
......@@ -225,7 +225,6 @@ CREATE TABLE MOUNT_POLICY(
ARCHIVE_MIN_REQUEST_AGE BIGINT UNSIGNED CONSTRAINT MOUNT_POLICY_AMRA_NN NOT NULL,
RETRIEVE_PRIORITY BIGINT UNSIGNED CONSTRAINT MOUNT_POLICY_RP_NN NOT NULL,
RETRIEVE_MIN_REQUEST_AGE BIGINT UNSIGNED CONSTRAINT MOUNT_POLICY_RMRA_NN NOT NULL,
MAX_DRIVES_ALLOWED BIGINT UNSIGNED,
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,
......
......@@ -104,8 +104,8 @@ CREATE TABLE DISK_SYSTEM(
CREATE TABLE VIRTUAL_ORGANIZATION(
VIRTUAL_ORGANIZATION_ID NUMERIC(20, 0) CONSTRAINT VIRTUAL_ORGANIZATION_VOI_NN NOT NULL,
VIRTUAL_ORGANIZATION_NAME VARCHAR2(100) CONSTRAINT VIRTUAL_ORGANIZATION_VON_NN NOT NULL,
READ_MAX_DRIVES NUMERIC(20, 0),
WRITE_MAX_DRIVES NUMERIC(20, 0),
READ_MAX_DRIVES NUMERIC(20, 0) CONSTRAINT VIRTUAL_ORGANIZATION_RMD_NN NOT NULL,
WRITE_MAX_DRIVES NUMERIC(20, 0) CONSTRAINT VIRTUAL_ORGANIZATION_WMD_NN NOT NULL,
USER_COMMENT VARCHAR2(1000) CONSTRAINT VIRTUAL_ORGANIZATION_UC_NN NOT NULL,
CREATION_LOG_USER_NAME VARCHAR2(100) CONSTRAINT VIRTUAL_ORGANIZATION_CLUN_NN NOT NULL,
CREATION_LOG_HOST_NAME VARCHAR2(100) CONSTRAINT VIRTUAL_ORGANIZATION_CLHN_NN NOT NULL,
......@@ -257,7 +257,6 @@ CREATE TABLE MOUNT_POLICY(
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),
USER_COMMENT VARCHAR2(1000) CONSTRAINT MOUNT_POLICY_UC_NN NOT NULL,
CREATION_LOG_USER_NAME VARCHAR2(100) CONSTRAINT MOUNT_POLICY_CLUN_NN NOT NULL,
CREATION_LOG_HOST_NAME VARCHAR2(100) CONSTRAINT MOUNT_POLICY_CLHN_NN NOT NULL,
......
......@@ -86,8 +86,8 @@ CREATE TABLE DISK_SYSTEM(
CREATE TABLE VIRTUAL_ORGANIZATION(
VIRTUAL_ORGANIZATION_ID NUMERIC(20, 0) CONSTRAINT VIRTUAL_ORGANIZATION_VOI_NN NOT NULL,
VIRTUAL_ORGANIZATION_NAME VARCHAR(100) CONSTRAINT VIRTUAL_ORGANIZATION_VON_NN NOT NULL,
READ_MAX_DRIVES NUMERIC(20, 0),
WRITE_MAX_DRIVES NUMERIC(20, 0),
READ_MAX_DRIVES NUMERIC(20, 0) CONSTRAINT VIRTUAL_ORGANIZATION_RMD_NN NOT NULL,
WRITE_MAX_DRIVES NUMERIC(20, 0) CONSTRAINT VIRTUAL_ORGANIZATION_WMD_NN NOT NULL,
USER_COMMENT VARCHAR(1000) CONSTRAINT VIRTUAL_ORGANIZATION_UC_NN NOT NULL,
CREATION_LOG_USER_NAME VARCHAR(100) CONSTRAINT VIRTUAL_ORGANIZATION_CLUN_NN NOT NULL,
CREATION_LOG_HOST_NAME VARCHAR(100) CONSTRAINT VIRTUAL_ORGANIZATION_CLHN_NN NOT NULL,
......@@ -239,7 +239,6 @@ CREATE TABLE MOUNT_POLICY(
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),
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,
......
......@@ -58,8 +58,8 @@ CREATE TABLE DISK_SYSTEM(
CREATE TABLE VIRTUAL_ORGANIZATION(
VIRTUAL_ORGANIZATION_ID INTEGER CONSTRAINT VIRTUAL_ORGANIZATION_VOI_NN NOT NULL,
VIRTUAL_ORGANIZATION_NAME VARCHAR(100) CONSTRAINT VIRTUAL_ORGANIZATION_VON_NN NOT NULL,
READ_MAX_DRIVES INTEGER,
WRITE_MAX_DRIVES INTEGER,
READ_MAX_DRIVES INTEGER CONSTRAINT VIRTUAL_ORGANIZATION_RMD_NN NOT NULL,
WRITE_MAX_DRIVES INTEGER CONSTRAINT VIRTUAL_ORGANIZATION_WMD_NN NOT NULL,
USER_COMMENT VARCHAR(1000) CONSTRAINT VIRTUAL_ORGANIZATION_UC_NN NOT NULL,
CREATION_LOG_USER_NAME VARCHAR(100) CONSTRAINT VIRTUAL_ORGANIZATION_CLUN_NN NOT NULL,
CREATION_LOG_HOST_NAME VARCHAR(100) CONSTRAINT VIRTUAL_ORGANIZATION_CLHN_NN NOT NULL,
......@@ -211,7 +211,6 @@ CREATE TABLE MOUNT_POLICY(
ARCHIVE_MIN_REQUEST_AGE INTEGER CONSTRAINT MOUNT_POLICY_AMRA_NN NOT NULL,
RETRIEVE_PRIORITY INTEGER CONSTRAINT MOUNT_POLICY_RP_NN NOT NULL,
RETRIEVE_MIN_REQUEST_AGE INTEGER CONSTRAINT MOUNT_POLICY_RMRA_NN NOT NULL,
MAX_DRIVES_ALLOWED INTEGER,
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,
......
......@@ -8792,8 +8792,8 @@ namespace catalogue{
"CREATE TABLE VIRTUAL_ORGANIZATION("
" VIRTUAL_ORGANIZATION_ID NUMERIC(20, 0) CONSTRAINT VIRTUAL_ORGANIZATION_VOI_NN NOT NULL,"
" VIRTUAL_ORGANIZATION_NAME VARCHAR2(100) CONSTRAINT VIRTUAL_ORGANIZATION_VON_NN NOT NULL,"
" READ_MAX_DRIVES NUMERIC(20, 0),"
" WRITE_MAX_DRIVES NUMERIC(20, 0),"
" READ_MAX_DRIVES NUMERIC(20, 0) CONSTRAINT VIRTUAL_ORGANIZATION_RMD_NN NOT NULL,"
" WRITE_MAX_DRIVES NUMERIC(20, 0) CONSTRAINT VIRTUAL_ORGANIZATION_WMD_NN NOT NULL,"
" USER_COMMENT VARCHAR2(1000) CONSTRAINT VIRTUAL_ORGANIZATION_UC_NN NOT NULL,"
" CREATION_LOG_USER_NAME VARCHAR2(100) CONSTRAINT VIRTUAL_ORGANIZATION_CLUN_NN NOT NULL,"
" CREATION_LOG_HOST_NAME VARCHAR2(100) CONSTRAINT VIRTUAL_ORGANIZATION_CLHN_NN NOT NULL,"
......@@ -8945,7 +8945,6 @@ namespace catalogue{
" 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),"
" USER_COMMENT VARCHAR2(1000) CONSTRAINT MOUNT_POLICY_UC_NN NOT NULL,"
" CREATION_LOG_USER_NAME VARCHAR2(100) CONSTRAINT MOUNT_POLICY_CLUN_NN NOT NULL,"
" CREATION_LOG_HOST_NAME VARCHAR2(100) CONSTRAINT MOUNT_POLICY_CLHN_NN NOT NULL,"
......@@ -9150,8 +9149,8 @@ namespace catalogue{
"CREATE TABLE VIRTUAL_ORGANIZATION("
" VIRTUAL_ORGANIZATION_ID BIGINT UNSIGNED CONSTRAINT VIRTUAL_ORGANIZATION_VOI_NN NOT NULL,"
" VIRTUAL_ORGANIZATION_NAME VARCHAR(100) CONSTRAINT VIRTUAL_ORGANIZATION_VON_NN NOT NULL,"
" READ_MAX_DRIVES BIGINT UNSIGNED,"
" WRITE_MAX_DRIVES BIGINT UNSIGNED,"
" READ_MAX_DRIVES BIGINT UNSIGNED CONSTRAINT VIRTUAL_ORGANIZATION_RMD_NN NOT NULL,"
" WRITE_MAX_DRIVES BIGINT UNSIGNED CONSTRAINT VIRTUAL_ORGANIZATION_WMD_NN NOT NULL,"
" USER_COMMENT VARCHAR(1000) CONSTRAINT VIRTUAL_ORGANIZATION_UC_NN NOT NULL,"
" CREATION_LOG_USER_NAME VARCHAR(100) CONSTRAINT VIRTUAL_ORGANIZATION_CLUN_NN NOT NULL,"
" CREATION_LOG_HOST_NAME VARCHAR(100) CONSTRAINT VIRTUAL_ORGANIZATION_CLHN_NN NOT NULL,"
......@@ -9303,7 +9302,6 @@ namespace catalogue{
" ARCHIVE_MIN_REQUEST_AGE BIGINT UNSIGNED CONSTRAINT MOUNT_POLICY_AMRA_NN NOT NULL,"
" RETRIEVE_PRIORITY BIGINT UNSIGNED CONSTRAINT MOUNT_POLICY_RP_NN NOT NULL,"
" RETRIEVE_MIN_REQUEST_AGE BIGINT UNSIGNED CONSTRAINT MOUNT_POLICY_RMRA_NN NOT NULL,"
" MAX_DRIVES_ALLOWED BIGINT UNSIGNED,"
" 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,"
......@@ -9493,8 +9491,8 @@ namespace catalogue{
"CREATE TABLE VIRTUAL_ORGANIZATION("
" VIRTUAL_ORGANIZATION_ID INTEGER CONSTRAINT VIRTUAL_ORGANIZATION_VOI_NN NOT NULL,"
" VIRTUAL_ORGANIZATION_NAME VARCHAR(100) CONSTRAINT VIRTUAL_ORGANIZATION_VON_NN NOT NULL,"
" READ_MAX_DRIVES INTEGER,"
" WRITE_MAX_DRIVES INTEGER,"
" READ_MAX_DRIVES INTEGER CONSTRAINT VIRTUAL_ORGANIZATION_RMD_NN NOT NULL,"
" WRITE_MAX_DRIVES INTEGER CONSTRAINT VIRTUAL_ORGANIZATION_WMD_NN NOT NULL,"
" USER_COMMENT VARCHAR(1000) CONSTRAINT VIRTUAL_ORGANIZATION_UC_NN NOT NULL,"
" CREATION_LOG_USER_NAME VARCHAR(100) CONSTRAINT VIRTUAL_ORGANIZATION_CLUN_NN NOT NULL,"
" CREATION_LOG_HOST_NAME VARCHAR(100) CONSTRAINT VIRTUAL_ORGANIZATION_CLHN_NN NOT NULL,"
......@@ -9646,7 +9644,6 @@ namespace catalogue{
" ARCHIVE_MIN_REQUEST_AGE INTEGER CONSTRAINT MOUNT_POLICY_AMRA_NN NOT NULL,"
" RETRIEVE_PRIORITY INTEGER CONSTRAINT MOUNT_POLICY_RP_NN NOT NULL,"
" RETRIEVE_MIN_REQUEST_AGE INTEGER CONSTRAINT MOUNT_POLICY_RMRA_NN NOT NULL,"
" MAX_DRIVES_ALLOWED INTEGER,"
" 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,"
......@@ -9862,8 +9859,8 @@ namespace catalogue{
"CREATE TABLE VIRTUAL_ORGANIZATION("
" VIRTUAL_ORGANIZATION_ID NUMERIC(20, 0) CONSTRAINT VIRTUAL_ORGANIZATION_VOI_NN NOT NULL,"
" VIRTUAL_ORGANIZATION_NAME VARCHAR(100) CONSTRAINT VIRTUAL_ORGANIZATION_VON_NN NOT NULL,"
" READ_MAX_DRIVES NUMERIC(20, 0),"
" WRITE_MAX_DRIVES NUMERIC(20, 0),"
" READ_MAX_DRIVES NUMERIC(20, 0) CONSTRAINT VIRTUAL_ORGANIZATION_RMD_NN NOT NULL,"
" WRITE_MAX_DRIVES NUMERIC(20, 0) CONSTRAINT VIRTUAL_ORGANIZATION_WMD_NN NOT NULL,"
" USER_COMMENT VARCHAR(1000) CONSTRAINT VIRTUAL_ORGANIZATION_UC_NN NOT NULL,"
" CREATION_LOG_USER_NAME VARCHAR(100) CONSTRAINT VIRTUAL_ORGANIZATION_CLUN_NN NOT NULL,"
" CREATION_LOG_HOST_NAME VARCHAR(100) CONSTRAINT VIRTUAL_ORGANIZATION_CLHN_NN NOT NULL,"
......@@ -10015,7 +10012,6 @@ namespace catalogue{
" 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),"
" 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,"
......
......@@ -37,8 +37,8 @@ CREATE TABLE DISK_SYSTEM(
CREATE TABLE VIRTUAL_ORGANIZATION(
VIRTUAL_ORGANIZATION_ID UINT64TYPE CONSTRAINT VIRTUAL_ORGANIZATION_VOI_NN NOT NULL,
VIRTUAL_ORGANIZATION_NAME VARCHAR(100) CONSTRAINT VIRTUAL_ORGANIZATION_VON_NN NOT NULL,
READ_MAX_DRIVES UINT64TYPE,
WRITE_MAX_DRIVES UINT64TYPE,
READ_MAX_DRIVES UINT64TYPE CONSTRAINT VIRTUAL_ORGANIZATION_RMD_NN NOT NULL,
WRITE_MAX_DRIVES UINT64TYPE CONSTRAINT VIRTUAL_ORGANIZATION_WMD_NN NOT NULL,
USER_COMMENT VARCHAR(1000) CONSTRAINT VIRTUAL_ORGANIZATION_UC_NN NOT NULL,
CREATION_LOG_USER_NAME VARCHAR(100) CONSTRAINT VIRTUAL_ORGANIZATION_CLUN_NN NOT NULL,
CREATION_LOG_HOST_NAME VARCHAR(100) CONSTRAINT VIRTUAL_ORGANIZATION_CLHN_NN NOT NULL,
......@@ -190,7 +190,6 @@ CREATE TABLE MOUNT_POLICY(
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,
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,
......
......@@ -154,6 +154,21 @@ ALTER TABLE TAPE DROP COLUMN IS_READ_ONLY;
--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 VIRTUAL_ORGANIZATION MODIFY READ_MAX_DRIVES NUMERIC(20,0) CONSTRAINT VIRTUAL_ORGANIZATION_RMD_NN NOT NULL;
--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 VIRTUAL_ORGANIZATION MODIFY WRITE_MAX_DRIVES NUMERIC(20,0) CONSTRAINT VIRTUAL_ORGANIZATION_WMD_NN NOT NULL;
--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 MOUNT_POLICY DROP COLUMN MAX_DRIVES_ALLOWED;
--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;
UPDATE CTA_CATALOGUE SET STATUS='PRODUCTION';
UPDATE CTA_CATALOGUE SET SCHEMA_VERSION_MAJOR=4;
UPDATE CTA_CATALOGUE SET SCHEMA_VERSION_MINOR=0;
......
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