-- Migration from 083 to 084

--
-- Add a new "COPE_PLUGINS" table with containts
--
CREATE SEQUENCE CORE_PLUGIN_ID_SEQ;

CREATE TABLE CORE_PLUGINS (
    ID TECH_ID NOT NULL,
    NAME VARCHAR(200) NOT NULL, 
    version INTEGER NOT NULL, 
    REGISTRATION_TIMESTAMP TIME_STAMP_DFL NOT NULL DEFAULT CURRENT_TIMESTAMP);
    
ALTER TABLE CORE_PLUGINS ADD CONSTRAINT COPL_NAME_VER_UK UNIQUE(NAME,VERSION);

GRANT SELECT ON SEQUENCE CORE_PLUGIN_ID_SEQ TO GROUP OPENBIS_READONLY;
GRANT SELECT ON TABLE CORE_PLUGINS TO GROUP OPENBIS_READONLY;

