-- =============================================
-- ONVITE DIGITAL - Super Admin Schema
-- =============================================

CREATE DATABASE IF NOT EXISTS georizmj_onvite_superadmin DEFAULT CHARACTER SET utf8mb4;
USE georizmj_onvite_superadmin;

-- Background photos per project (up to 10)
CREATE TABLE IF NOT EXISTS project_photos (
  id          INT AUTO_INCREMENT PRIMARY KEY,
  project_id  INT NOT NULL,
  filename    VARCHAR(255) NOT NULL,
  sort_order  INT DEFAULT 0,
  FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE
);

-- Individual invitees
CREATE TABLE IF NOT EXISTS invitees (
  id              INT AUTO_INCREMENT PRIMARY KEY,
  invitation_id   INT NOT NULL,
  name            VARCHAR(255) NOT NULL,
  response_status ENUM('Accept','Decline') DEFAULT NULL,
  responded_at    DATETIME DEFAULT NULL,
  FOREIGN KEY (invitation_id) REFERENCES invitations(id) ON DELETE CASCADE
);
-- IMPORTANT: Run this PHP to generate your own hash:
-- echo password_hash('YourPassword', PASSWORD_BCRYPT);
