-- ===== schema.sql =====
CREATE TABLE IF NOT EXISTS visits (
  id INT AUTO_INCREMENT PRIMARY KEY,
  ts_server DATETIME NOT NULL,
  ip VARCHAR(100) NULL,
  referrer TEXT NULL,
  ua TEXT NULL,
  ts_client DATETIME NULL,
  INDEX idx_ts_server (ts_server),
  INDEX idx_ip (ip(32))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
