
CREATE TABLE IF NOT EXISTS mailing_lists
(
    id bigint PRIMARY KEY NOT NULL,
    title character varying(225),
    project_id bigint references projects(id),
    add_by character varying(225),
    deleted boolean,
    total_recipients bigint,
    channel_ids character varying(4000),
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    deleted_at timestamp with time zone
);

CREATE SEQUENCE mailing_lists_id_seq;

CREATE INDEX mailing_lists_mailing_lists_title_mailing_lists_project_id ON mailing_lists(title, project_id);
