CREATE TABLE actions (
    id BIGINT IDENTITY (1,1) PRIMARY KEY,
    title NVARCHAR(1000) NOT NULL ,
    action NVARCHAR(255),
    payload NVARCHAR(1000),
    chat_message_id BIGINT NOT NULL REFERENCES chat_messages(id),
    client_id BIGINT REFERENCES clients(id),
    [deleted] BIT NOT NULL,

    created_at DATETIMEOFFSET NOT NULL,
    updated_at DATETIMEOFFSET NOT NULL,
);

create index actions_actions_id_chat_message_id_ix
    on actions(id, chat_message_id);
