CREATE TABLE IF NOT EXISTS t_contact_messages (
    message_id          INT AUTO_INCREMENT PRIMARY KEY,
    message_name        VARCHAR(255) NOT NULL,
    message_email       VARCHAR(255) NOT NULL,
    message_subject     VARCHAR(255) NULL,
    message_body        TEXT NOT NULL,
    message_ip          VARCHAR(45) NULL,
    message_status      VARCHAR(20) NOT NULL DEFAULT 'new' COMMENT 'new, read, replied, archived',
    message_created_at  DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    INDEX idx01_contact_messages (message_status),
    INDEX idx02_contact_messages (message_created_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- DOWN

DROP TABLE IF EXISTS t_contact_messages;
