

CREATE TABLE tap_logs (
  id INT AUTO_INCREMENT PRIMARY KEY,
  user_id INT,
  created DATETIME DEFAULT CURRENT_TIMESTAMP,
  FOREIGN KEY (user_id) REFERENCES users(id)
);

CREATE TABLE redeem_logs (
  id INT AUTO_INCREMENT PRIMARY KEY,
  user_id INT,
  points INT,
  saldo INT,
  created DATETIME DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE withdraws (
  id INT AUTO_INCREMENT PRIMARY KEY,
  user_id INT,
  saldo INT,
  status ENUM('pending','approved','declined') DEFAULT 'pending',
  created DATETIME DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE settings (
  id INT AUTO_INCREMENT PRIMARY KEY,
  name VARCHAR(50) UNIQUE,
  value TEXT
);
