
CREATE TABLE users (
  id INT AUTO_INCREMENT PRIMARY KEY,
  user_id VARCHAR(50) UNIQUE,
  password VARCHAR(255),
  points INT DEFAULT 0
);

CREATE TABLE rewards (
  id INT AUTO_INCREMENT PRIMARY KEY,
  name VARCHAR(100),
  cost INT
);

CREATE TABLE redemptions (
  id INT AUTO_INCREMENT PRIMARY KEY,
  user_id VARCHAR(50),
  reward_id INT,
  redeemed_at DATETIME
);

CREATE TABLE conversions (
  id INT AUTO_INCREMENT PRIMARY KEY,
  user_id VARCHAR(50),
  points INT,
  ip VARCHAR(45),
  country_code VARCHAR(5),
  created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
