-- SQL for FB AutoBot dashboard
-- Create tables required for the system.

CREATE TABLE IF NOT EXISTS bot_posts (
  id INT AUTO_INCREMENT PRIMARY KEY,
  post_id VARCHAR(255) NOT NULL,
  status TINYINT(1) NOT NULL DEFAULT 1,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE IF NOT EXISTS bot_settings (
  id INT PRIMARY KEY,
  public_reply TEXT,
  private_reply TEXT,
  auto_hide TINYINT(1) DEFAULT 1,
  send_image TINYINT(1) DEFAULT 0,
  image_url TEXT
);

INSERT INTO bot_settings (id, public_reply, private_reply, auto_hide, send_image, image_url)
VALUES (1, 'Cảm ơn bạn đã quan tâm! Mình sẽ inbox ngay cho bạn ❤️', 'Chào bạn! Mình đã gửi thông tin vào inbox nhé ❤️', 1, 0, '');

CREATE TABLE IF NOT EXISTS bot_logs (
  id INT AUTO_INCREMENT PRIMARY KEY,
  post_id VARCHAR(255),
  comment_id VARCHAR(255),
  user_id VARCHAR(255),
  user_name VARCHAR(255),
  message TEXT,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
