CREATE TABLE IF NOT EXISTS app_settings (
  k VARCHAR(190) PRIMARY KEY,
  v TEXT,
  updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- opsional, log ringan untuk debug (boleh di-skip)
CREATE TABLE IF NOT EXISTS checks_log (
  id BIGINT AUTO_INCREMENT PRIMARY KEY,
  url TEXT NOT NULL,
  last_poster VARCHAR(255) DEFAULT NULL,
  last3 TEXT DEFAULT NULL,
  my_user VARCHAR(255) DEFAULT NULL,
  ok TINYINT(1) DEFAULT 0, -- 1 = HIJAU (bukan kamu), 0 = MERAH (kamu sendiri)
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
