
--
-- For an Oracle database backend : 
-- script to migrate the schema from the first version to version 1.1.0 
--
-- Author : Sophie Lemaitre <Sophie.Lemaitre@cern.ch>
--


-- Add the "status" and "poolname" fields"

ALTER TABLE Cns_file_replica ADD ( status CHAR(1) );
ALTER TABLE Cns_file_replica ADD ( poolname VARCHAR2(15) );
ALTER TABLE Cns_file_replica ADD ( fs VARCHAR2(79) );
ALTER TABLE Cns_file_replica ADD ( f_type CHAR(1) );

-- Create an index on Cns_file_metadata(PARENT_FILEID)

create index PARENT_FILEID_IDX on Cns_file_metadata(PARENT_FILEID);

-- Create the "schema_version" table

DROP TABLE schema_version;
CREATE TABLE schema_version (major NUMBER(1), minor NUMBER(1), patch NUMBER(1));
INSERT INTO schema_version VALUES (1, 1, 1);


