-- Adds a table for after-hours contact form submissions (shown when no chat coverage).
CREATE TABLE IF NOT EXISTS chat_offline_messages (
  id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  visitor_name VARCHAR(128) NOT NULL,
  visitor_email VARCHAR(191) NOT NULL,
  zip_code VARCHAR(16) NOT NULL,
  order_number VARCHAR(64) NULL,
  subject VARCHAR(255) NOT NULL,
  message TEXT NOT NULL,
  page_url VARCHAR(500) NULL,
  site VARCHAR(64) NULL,
  created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  emailed TINYINT(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
