SET NAMES utf8mb4;
ALTER TABLE operational_inbox_items ADD COLUMN description TEXT NULL AFTER title;
ALTER TABLE operational_inbox_events ADD COLUMN metadata LONGTEXT NULL AFTER user_id;
CREATE TABLE IF NOT EXISTS operational_inbox_comments (
 id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,workspace_id BIGINT UNSIGNED NOT NULL,item_id BIGINT UNSIGNED NOT NULL,user_id BIGINT UNSIGNED NOT NULL,body TEXT NOT NULL,created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
 INDEX idx_oic_item_time(item_id,created_at),CONSTRAINT fk_oic_workspace FOREIGN KEY(workspace_id) REFERENCES workspaces(id) ON DELETE CASCADE,CONSTRAINT fk_oic_item FOREIGN KEY(item_id) REFERENCES operational_inbox_items(id) ON DELETE CASCADE,CONSTRAINT fk_oic_user FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
