CREATE TABLE users (
  id INT AUTO_INCREMENT PRIMARY KEY,
  username VARCHAR(50) UNIQUE NOT NULL,
  password VARCHAR(255) NOT NULL, -- bcrypt hash
  role ENUM('superadmin','admin','user') NOT NULL DEFAULT 'user',
  created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE websites (
  id INT AUTO_INCREMENT PRIMARY KEY,
  name VARCHAR(255) NOT NULL,
  url TEXT NOT NULL,
  telegram_chat_id VARCHAR(255) NOT NULL,
  last_status VARCHAR(20) DEFAULT NULL,
  last_checked DATETIME DEFAULT NULL,
  is_disabled TINYINT(1) DEFAULT 0,
  error_count INT DEFAULT 0,
  reminder INT DEFAULT 0
);