CREATE TABLE chats_history (
    history_event_id SERIAL PRIMARY KEY,
    history_user_id text NOT NULL,
    history_originator_id text,
    history_action text NOT NULL,
    history_timestamp integer NOT NULL,
    history_comment text,

    chat_id integer NOT NULL,
    search_id text NOT NULL,
    title text NOT NULL,
    handler_chat_id text,
    topic text,
    object_id character varying(36),
    is_archive boolean,
    flags integer
);
