CREATE DATABASE IF NOT EXISTS profile_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
USE profile_db;

CREATE TABLE IF NOT EXISTS profile_images (
  id INT AUTO_INCREMENT PRIMARY KEY,
  user_id INT NOT NULL,
  filename VARCHAR(255) NOT NULL,
  original_name VARCHAR(255) NOT NULL,
  mime VARCHAR(100) NOT NULL,
  size_bytes INT NOT NULL,
  status ENUM('pending_review','approved','rejected') DEFAULT 'pending_review',
  admin_note TEXT NULL,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  reviewed_at DATETIME NULL
);

CREATE INDEX idx_profile_images_status ON profile_images(status);
CREATE INDEX idx_profile_images_user ON profile_images(user_id);
