-- Migration: create vip_requests table and add is_vip column to users
-- Run this in your MySQL client (phpMyAdmin, mysql CLI) while connected to the 'niata_sports' database.

CREATE TABLE IF NOT EXISTS vip_requests (
  id INT AUTO_INCREMENT PRIMARY KEY,
  user_id INT NOT NULL,
  message TEXT DEFAULT NULL,
  status ENUM('pending','approved','denied') NOT NULL DEFAULT 'pending',
  created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  INDEX (user_id),
  CONSTRAINT fk_vip_requests_user FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Add a simple is_vip flag to users table if it does not exist
ALTER TABLE users
  ADD COLUMN IF NOT EXISTS is_vip TINYINT(1) NOT NULL DEFAULT 0;
