-- migrate:up
CREATE TABLE crm_message (
    id INT AUTO_INCREMENT PRIMARY KEY,
    facebook_msg_id VARCHAR(255) NULL,
    sender_id INT NOT NULL,
    receiver_id INT NOT NULL,
    message_text TEXT NOT NULL,
    media_path VARCHAR(255) NULL,
    sent_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    FOREIGN KEY (sender_id) REFERENCES crm_contact(id),
    FOREIGN KEY (receiver_id) REFERENCES crm_contact(id)
);

-- migrate:down
DROP TABLE IF EXISTS crm_message;
