-- this script adds a TASK_COMMENT table and updates the table TASKANA_SCHEMA_VERSION.

SET SCHEMA %schemaName%;

INSERT INTO TASKANA_SCHEMA_VERSION (VERSION, CREATED) VALUES ('2.0.2', CURRENT_TIMESTAMP);

CREATE TABLE TASK_COMMENT(
    ID CHAR(40) NOT NULL,
    TASK_ID CHAR(40) NOT NULL,
    TEXT_FIELD VARCHAR(1024) NULL,
    CREATOR VARCHAR(32) NULL,
    CREATED TIMESTAMP NULL,
    MODIFIED TIMESTAMP NULL,
    PRIMARY KEY (ID),
    CONSTRAINT COMMENT_TASK FOREIGN KEY (TASK_ID) REFERENCES TASK ON DELETE CASCADE
);