USE pacs;

ALTER TABLE DICOM_OBJECTS ADD COLUMN UPLOAD_DATE TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP comment 'Date and time of object uploading';
ALTER TABLE DICOM_OBJECTS ADD COLUMN COMPRESSED tinyint(1) NOT NULL DEFAULT 0 comment 'Flag is object already compressed';
ALTER TABLE DICOM_OBJECTS ADD COLUMN UPLOADED_TO_REGIONAL tinyint(1) NOT NULL DEFAULT 0 comment 'Flag is object uploaded to the Regional PACS';
CREATE INDEX OBJECTS_ARCHIVED ON DICOM_OBJECTS(ID, UPLOAD_DATE, COMPRESSED);

COMMIT;
