-- =============================================================================
--  SUPERNOVA 2.0 — Master Database Setup
--  File    : database.sql
--  Location: Supernova 2026/ (project root)
--
--  This is the single master database file that combines:
--    1. schema.sql                        → All table definitions
--    2. migration_2026-08-13_security.sql → Security patches
--    3. seed_events.sql                   → All 9 events, coordinators & users
--    4. update_venues.sql                 → Venue corrections (baked into seeds)
--
--  HOW TO USE:
--    Local  : Run in phpMyAdmin → Import → select this file
--    SSH    : mysql -u root -p < database.sql
--    XAMPP  : mysql -u root supernova_db < database.sql
--
--  SAFE TO RE-RUN: Yes. Uses IF NOT EXISTS / INSERT IGNORE / DROP IF EXISTS.
-- =============================================================================

-- ─────────────────────────────────────────────────────────────────────────────
-- SECTION 1: DATABASE CREATION
-- ─────────────────────────────────────────────────────────────────────────────

CREATE DATABASE IF NOT EXISTS `supernova_db`
  CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

USE `supernova_db`;

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
SET FOREIGN_KEY_CHECKS = 0;

-- ─────────────────────────────────────────────────────────────────────────────
-- SECTION 2: TABLE DEFINITIONS (schema.sql)
-- ─────────────────────────────────────────────────────────────────────────────

-- Users (admins, organizers, finance officers)
CREATE TABLE IF NOT EXISTS `users` (
  `id`        varchar(36)  NOT NULL,
  `name`      varchar(255) NOT NULL,
  `email`     varchar(255) NOT NULL,
  `password`  varchar(255) NOT NULL,
  `role`      enum('ADMIN','ORGANIZER','FINANCE') NOT NULL,
  `createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Events
CREATE TABLE IF NOT EXISTS `events` (
  `id`              varchar(36)  NOT NULL,
  `title`           varchar(255) NOT NULL,
  `slug`            varchar(255) NOT NULL,
  `category`        varchar(255) NOT NULL,
  `description`     text         NOT NULL,
  `rules`           json         DEFAULT NULL,
  `bannerUrl`       varchar(255) DEFAULT NULL,
  `venue`           varchar(255) NOT NULL,
  `eventDate`       varchar(255) NOT NULL,
  `reportingTime`   varchar(255) NOT NULL,
  `registrationFee` decimal(10,2) NOT NULL DEFAULT '0.00',
  `prizePool`       decimal(10,2) NOT NULL DEFAULT '0.00',
  `status`          enum('DRAFT','PENDING_APPROVAL','PUBLISHED','COMPLETED','CANCELLED') NOT NULL DEFAULT 'DRAFT',
  `customFields`    json         DEFAULT NULL,
  `organizerId`     varchar(36)  DEFAULT NULL,
  `createdAt`       timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updatedAt`       timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `slug` (`slug`),
  KEY `organizerId` (`organizerId`),
  CONSTRAINT `events_ibfk_1` FOREIGN KEY (`organizerId`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Event Coordinators
CREATE TABLE IF NOT EXISTS `coordinators` (
  `id`      varchar(36)  NOT NULL,
  `name`    varchar(255) NOT NULL,
  `phone`   varchar(255) DEFAULT NULL,
  `email`   varchar(255) DEFAULT NULL,
  `eventId` varchar(36)  NOT NULL,
  PRIMARY KEY (`id`),
  KEY `eventId` (`eventId`),
  CONSTRAINT `coordinators_ibfk_1` FOREIGN KEY (`eventId`) REFERENCES `events` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Registrations
CREATE TABLE IF NOT EXISTS `registrations` (
  `id`             varchar(36)  NOT NULL,
  `registrationId` varchar(255) NOT NULL,
  `fullName`       varchar(255) NOT NULL,
  `email`          varchar(255) NOT NULL,
  `mobileNumber`   varchar(255) NOT NULL,
  `college`        varchar(255) NOT NULL,
  `city`           varchar(255) NOT NULL,
  `customAnswers`  json         DEFAULT NULL,
  `importSource`   varchar(255) DEFAULT NULL,
  `eventId`        varchar(36)  NOT NULL,
  `createdAt`      timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updatedAt`      timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `registrationId` (`registrationId`),
  UNIQUE KEY `email_eventId` (`email`,`eventId`),
  KEY `eventId` (`eventId`),
  CONSTRAINT `registrations_ibfk_1` FOREIGN KEY (`eventId`) REFERENCES `events` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Payments (Razorpay)
CREATE TABLE IF NOT EXISTS `payments` (
  `id`                 varchar(36)  NOT NULL,
  `registrationId`     varchar(36)  NOT NULL,
  `razorpayOrderId`    varchar(255) NOT NULL,
  `razorpayPaymentId`  varchar(255) DEFAULT NULL,
  `razorpaySignature`  varchar(255) DEFAULT NULL,
  `amount`             decimal(10,2) NOT NULL,
  `currency`           varchar(10)  NOT NULL DEFAULT 'INR',
  `status`             enum('PENDING','SUCCESSFUL','FAILED','REFUNDED') NOT NULL DEFAULT 'PENDING',
  `failureReason`      varchar(255) DEFAULT NULL,
  `createdAt`          timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updatedAt`          timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `registrationId`    (`registrationId`),
  UNIQUE KEY `razorpayOrderId`   (`razorpayOrderId`),
  UNIQUE KEY `razorpayPaymentId` (`razorpayPaymentId`),
  CONSTRAINT `payments_ibfk_1` FOREIGN KEY (`registrationId`) REFERENCES `registrations` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Attendance (QR Scan)
CREATE TABLE IF NOT EXISTS `attendance` (
  `id`             varchar(36) NOT NULL,
  `registrationId` varchar(36) NOT NULL,
  `eventId`        varchar(36) NOT NULL,
  `scannedAt`      timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `registrationId` (`registrationId`),
  KEY `eventId` (`eventId`),
  CONSTRAINT `attendance_ibfk_1` FOREIGN KEY (`registrationId`) REFERENCES `registrations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `attendance_ibfk_2` FOREIGN KEY (`eventId`)        REFERENCES `events`        (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Certificates
CREATE TABLE IF NOT EXISTS `certificates` (
  `id`             varchar(36)  NOT NULL,
  `certificateNo`  varchar(255) NOT NULL,
  `registrationId` varchar(36)  NOT NULL,
  `eventId`        varchar(36)  NOT NULL,
  `pdfUrl`         varchar(255) DEFAULT NULL,
  `issuedAt`       timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `certificateNo`  (`certificateNo`),
  UNIQUE KEY `registrationId` (`registrationId`),
  KEY `eventId` (`eventId`),
  CONSTRAINT `certificates_ibfk_1` FOREIGN KEY (`registrationId`) REFERENCES `registrations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `certificates_ibfk_2` FOREIGN KEY (`eventId`)        REFERENCES `events`        (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Committee Members
CREATE TABLE IF NOT EXISTS `committee_members` (
  `id`       varchar(36)  NOT NULL,
  `name`     varchar(255) NOT NULL,
  `role`     varchar(255) NOT NULL,
  `photoUrl` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Login Throttle (brute-force protection)
CREATE TABLE IF NOT EXISTS `login_throttle` (
  `id`          bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `identifier`  varchar(320) NOT NULL,
  `attemptedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `ident_time` (`identifier`, `attemptedAt`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Sponsors
CREATE TABLE IF NOT EXISTS `sponsors` (
  `id`      varchar(36)  NOT NULL,
  `name`    varchar(255) NOT NULL,
  `logoUrl` varchar(255) NOT NULL,
  `website` varchar(255) DEFAULT NULL,
  `tier`    varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ─────────────────────────────────────────────────────────────────────────────
-- SECTION 3: SECURITY PATCHES (migration_2026-08-13_security.sql)
-- Safe to run on an existing or fresh database — uses IF/ALTER safely.
-- ─────────────────────────────────────────────────────────────────────────────

-- Ensure events.status includes PENDING_APPROVAL (already in schema above,
-- this ALTER is safe to run again and a no-op on a fresh install).
ALTER TABLE `events`
  MODIFY `status` enum('DRAFT','PENDING_APPROVAL','PUBLISHED','COMPLETED','CANCELLED') NOT NULL DEFAULT 'DRAFT';

-- Ensure registrations.importSource column exists (idempotent guard).
SET @col_exists := (SELECT COUNT(*) FROM information_schema.COLUMNS
  WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'registrations' AND COLUMN_NAME = 'importSource');
SET @ddl := IF(@col_exists = 0,
  'ALTER TABLE `registrations` ADD COLUMN `importSource` varchar(255) DEFAULT NULL',
  'SELECT 1');
PREPARE stmt FROM @ddl; EXECUTE stmt; DEALLOCATE PREPARE stmt;

-- ─────────────────────────────────────────────────────────────────────────────
-- SECTION 4: SEED DATA — Events, Coordinators & Users (seed_events.sql)
-- Venue corrections from update_venues.sql are baked directly into these rows.
-- Uses INSERT IGNORE so duplicate re-runs are safe.
-- ─────────────────────────────────────────────────────────────────────────────

-- 1. Battleclipse
SET @id1 = UUID();
INSERT IGNORE INTO events (id, title, slug, category, description, venue, eventDate, reportingTime, registrationFee, prizePool, status, rules) VALUES
(@id1, 'Battleclipse - esports', 'battleclipse-esports', 'Gaming & esports',
 'Thrilling multiplayer esports gaming tournament featuring BGMI and FREE FIRE! Form your squad and evaluate your strategy, team coordination, and swift reflexes.',
 'CR-07,08,09, Old Chemistry Lab, Third Floor', '4 and 5 September 2026', '10:00 AM', 200, 8000, 'PUBLISHED',
 '["Choose your battleground: BGMI or Free Fire.","Each team must have 4 Players.","No On-spot Registrations will be accepted.","All Matches will be Knockout Matches.","Any abusive language, harassment, racism, or unsportsmanlike conduct will result in penalties or immediate disqualification.","The organizers'' decision shall be final in all disputes.","Players must use their own smartphones.","Players are responsible for their own internet connection. Internet interruption from the player\'s side is considered the player\'s responsibility.","The match will not be restarted due to individual disconnections.","In case of server-wide technical issues, organizers may decide to restart the match.","Only registered players may participate.","Teaming with other squads is strictly prohibited."]');
INSERT IGNORE INTO coordinators (id, name, phone, eventId) VALUES
  (UUID(), 'Vansh Joshi',       '9075404897', @id1),
  (UUID(), 'Abhishek Bijarane', '9370648410', @id1);

-- 2. Cosmobolt
SET @id2 = UUID();
INSERT IGNORE INTO events (id, title, slug, category, description, venue, eventDate, reportingTime, registrationFee, prizePool, status, rules) VALUES
(@id2, 'Cosmobolt - Roborace', 'cosmobolt-roborace', 'Robotics & Competition',
 'Thrilling robotics race testing speed, agility, and navigation control on a customized obstacle track.',
 'Drawing Hall, Third Floor', '4 Sep 2026', '10:00 AM', 200, 10000, 'PUBLISHED',
 '["Robot Specifications:","- The maximum size limit of the robot is 1 ft x 1 ft.","- Both wired and wireless control systems are allowed.","- Robots must be self-powered (battery operated). External power supply during the race is not allowed.","- Weight should be under 2 kg.","- Sharp or harmful components are prohibited (safety priority).","- Any robot found damaging the track will be disqualified.","Track Dimensions:","- Width 1.5 ft.","Competition Rules:","- Teams must report 30 minutes before their scheduled slot.","- The race will be a time-based competition and points.","- The team with the fastest time to complete the track and maximum points will be declared winner.","- Judges'' decision will be final and binding.","- External assistance during the race will lead to immediate disqualification.","- If a robot goes out of the track (Track not Obstacles), it must be placed back at the last save point.","- If Robot suffers with any damage during race, Organizing team will not provide any support for it."]');
INSERT IGNORE INTO coordinators (id, name, phone, eventId) VALUES
  (UUID(), 'Shahebaz Shaikh', '9420022733', @id2),
  (UUID(), 'Aniruddha Shebe', '9022577680', @id2);

-- 3. Protonova
SET @id3 = UUID();
INSERT IGNORE INTO events (id, title, slug, category, description, venue, eventDate, reportingTime, registrationFee, prizePool, status, rules) VALUES
(@id3, 'Protonova - Project Competition', 'protonova-project-competition', 'Project Showcase',
 'National-level flagship hardware and software project exhibition judged by industry expert panels.',
 'Integrated Classroom, First Floor', '4 Sep 2026', '10:00 AM', 200, 25000, 'PUBLISHED',
 '["Team size - 1-4 members","Bring your own extension box (power strips) if your project requires electricity.","You can bring posters or banners to decorate your project table"]');
INSERT IGNORE INTO coordinators (id, name, phone, eventId) VALUES
  (UUID(), 'Kajal Patil',  '9209301506', @id3),
  (UUID(), 'Sakshi Kudke', '8668543495', @id3),
  (UUID(), 'Sejal More',   '9834516120', @id3);

-- 4. Junior Shark
SET @id4 = UUID();
INSERT IGNORE INTO events (id, title, slug, category, description, venue, eventDate, reportingTime, registrationFee, prizePool, status, rules) VALUES
(@id4, 'Junior Shark - Pitch Beyond the Stars', 'junior-shark-pitch-beyond-the-stars', 'Business & Entrepreneurship',
 'Shark-tank style startup pitch contest evaluating market feasibility, valuation, and business strategy.',
 'Einstein Hall', '5 Sep 2026', '01:00 PM', 100, 20000, 'PUBLISHED',
 '["Team Size: Each team may consist of a maximum of 4 members.","Pitch Time: Each team will get 5 minutes to present their business idea.","Q&A Round: A maximum of 2 minutes will be allotted for the Question & Answer round.","Originality: The business idea must be original, innovative, and creative.","Eligibility: Only students studying in 8th, 9th, 10th or 11th, 12th standard are eligible to participate.","Participation is allowed only from recognized schools. Students from coaching classes or firms are not eligible.","Time Management: Teams must strictly follow the allotted time limit. Exceeding the time may affect the evaluation.","Fair Play: Any form of cheating, plagiarism, or unfair practice will result in immediate disqualification.","Discipline & Conduct: All participants must maintain discipline, professionalism, and respectful behaviour throughout the event.","Judges'' Decision: The decision of the judges will be final and binding.","Reporting Time: Teams must report to the venue before their allotted presentation time.","Participants must carry their valid school ID or other proof of eligibility, if required."]');
INSERT IGNORE INTO coordinators (id, name, phone, eventId) VALUES
  (UUID(), 'Hameed Khan',   '9657678595', @id4),
  (UUID(), 'Anandi Dubey',  '8623892948', @id4),
  (UUID(), 'Aachal Pawar',  '8275918075', @id4);

-- 5. Ninja Coders
SET @id5 = UUID();
INSERT IGNORE INTO events (id, title, slug, category, description, venue, eventDate, reportingTime, registrationFee, prizePool, status, rules) VALUES
(@id5, 'Ninja Coders - Take the Ninja Road', 'ninja-coders-take-the-ninja-road', 'Speed Coding & Debugging',
 'High-speed debugging and live code optimization under severe time pressure.',
 'Java Programming Lab, CR- 12 Fourth Floor', '4 and 5 Sep 2026', '10:00 AM', 100, 8000, 'PUBLISHED',
 '["Team Size: 1 Participants","Valid College ID is mandatory.","Programming Languages: C, C++, Java","Use of mobile phones or other electronic devices is prohibited.","Unfair means will lead to immediate disqualification.","Eligibility - 1st year reg and 1st and 2nd year integrated students allowed only"]');
INSERT IGNORE INTO coordinators (id, name, phone, eventId) VALUES
  (UUID(), 'Aditya Agrawal', '9209764458', @id5);

-- 6. SparkX
SET @id6 = UUID();
INSERT IGNORE INTO events (id, title, slug, category, description, venue, eventDate, reportingTime, registrationFee, prizePool, status, rules) VALUES
(@id6, 'SparkX - Startup Pitching', 'sparkx-startup-pitching', 'Ideation & Pitching',
 'The Arena of Bold Ideas — Fast-paced startup pitching arena where tech visionaries present novel solutions to executive jury panels.',
 'Aryabhatta Hall', '4 and 5 Sep 2026', '10:00 AM', 200, 15000, 'PUBLISHED',
 '["Team Size: 1\u20134 members per team.","Eligibility: Open to participants from any college, university, institution, or city.","Startup Stage: Idea-stage, existing, and MVP/prototype-stage startups are welcome.","Dress Code: Formal Western Suits.","Pitch Deck: Participants must use the official SPARK X Pitch Deck template and cover all required points.","Round 1: Each team gets 5 minutes for an individual pitch before the assigned jury.","SPARK Challenge: Teams will answer 5 surprise questions covering business, market, technology, crisis management, and problem-solving.","Idea Wall: Each team must prepare an A4-size poster showcasing their startup idea.","Grand Finale: Shortlisted teams will pitch on stage for 10 minutes before the combined jury.","Audience Vote: Audience voting will take place after the finalist pitches and will contribute to the final evaluation.","Awards: Top 3 winners + Best Innovation, Best Pitch, Best Business Model & Best Social Impact.","Final Decision: The decision of the jury and organizers will be final and binding."]');
INSERT IGNORE INTO coordinators (id, name, phone, eventId) VALUES
  (UUID(), 'Abdul Malik',  '9307681367', @id6),
  (UUID(), 'Abdul Haseeb', '9637321222', @id6);

-- 7. Infinity Lab
SET @id7 = UUID();
INSERT IGNORE INTO events (id, title, slug, category, description, venue, eventDate, reportingTime, registrationFee, prizePool, status, rules) VALUES
(@id7, 'Infinity Lab - Technical Workshop', 'infinity-lab-technical-workshop', 'Hands-on Training',
 'Hands-on technical workshop on emerging cloud architecture, AI workflows, and modern web application development.',
 'Integrated Classroom, First Floor', '5 Sep 2026', '01:30 PM', 200, 0, 'PUBLISHED',
 '["Bringing your own laptop is compulsory.","Individual registration."]');
INSERT IGNORE INTO coordinators (id, name, phone, eventId) VALUES
  (UUID(), 'Shrushti Doifode', '9356221049', @id7),
  (UUID(), 'Shankar Todkar',   '9175339995', @id7);

-- 8. Stellar Hackathon
SET @id8 = UUID();
INSERT IGNORE INTO events (id, title, slug, category, description, venue, eventDate, reportingTime, registrationFee, prizePool, status, rules) VALUES
(@id8, 'Stellar - Hackthon', 'stellar-hackthon', 'Coding & Algorithm',
 'Design hackathon focusing on futuristic web interfaces, user experience, and visual aesthetics.',
 'CC Lab & CR-01 First Floor', '5 Sep 2026', '11:00 AM', 300, 12000, 'PUBLISHED',
 '["Team size must be 2-5 members.","Teams must bring their own laptops with all required software/tools installed.","Internet and power backup will be provided by the organizers.","Bring your College ID, registration/payment receipt, selected problem statement, and PPT presentation.","Plagiarism or undisclosed pre-built solutions will result in disqualification.","Participants must maintain discipline and respect judges, organizers, and fellow competitors.","Each team will be allotted 15-20 minutes to present their PowerPoint presentation.","All finalist teams must present a 10-15 minute live demo.","The organizers'' decision regarding evaluation and results will be final and binding.","All work must be completed and submitted before the 5:30 PM deadline."]');
INSERT IGNORE INTO coordinators (id, name, phone, eventId) VALUES
  (UUID(), 'Dhananjay Kadge', '7559328100', @id8),
  (UUID(), 'Ajinkya Shirpe',  '7276739067', @id8);

-- 9. CodeBurst
SET @id9 = UUID();
INSERT IGNORE INTO events (id, title, slug, category, description, venue, eventDate, reportingTime, registrationFee, prizePool, status, rules) VALUES
(@id9, 'CodeBurst - Competative Programming', 'codeburst-competative-programming', 'Coding & Algorithm',
 'Competitive coding challenge testing speed, accuracy, and algorithmic problem solving.',
 'Computer Centeral Lab, CR-1', '4 Sep 2026', '10:00 AM', 100, 10000, 'PUBLISHED',
 '["Team Size: 1-2 Participants","Valid College ID is mandatory.","Programming Languages: C, C++, Java","Use of mobile phones or other electronic devices is prohibited.","Unfair means will lead to immediate disqualification."]');
INSERT IGNORE INTO coordinators (id, name, phone, eventId) VALUES
  (UUID(), 'Harshada Nikam',  '7768886650', @id9),
  (UUID(), 'Gaurang Udgirkar','9021008369', @id9);

-- ─────────────────────────────────────────────────────────────────────────────
-- SECTION 5: DEFAULT SYSTEM USERS
-- Passwords are bcrypt hashed — never stored in plain text.
-- ─────────────────────────────────────────────────────────────────────────────

-- Admin: sushantw3124@gmail.com | FinalPro213#
INSERT IGNORE INTO users (id, name, email, password, role) VALUES
  (UUID(), 'Sushant Wankhade', 'sushantw3124@gmail.com',
   '$2y$10$sCHXXXPzOTK0w79t15TXlO6buy7TZy.pyYBS6bXXyTBYM6YnGpN/W', 'ADMIN');

-- Admin: mh20agnes@gmail.com | Timex+44
INSERT IGNORE INTO users (id, name, email, password, role) VALUES
  (UUID(), 'Kshitij Pingale', 'mh20agnes@gmail.com',
   '$2y$10$nMivl/l8nua5XgMmxRtfterCZNFpMpiDUcek6EKuKF1X2VWn9a0aq', 'ADMIN');

-- Legacy Admin: SuperNovaAD@mgm.org | SNadmin123
INSERT IGNORE INTO users (id, name, email, password, role) VALUES
  (UUID(), 'Legacy Admin', 'SuperNovaAD@mgm.org',
   '$2y$10$UpXHgC/EwShNNxwjkjmfjOkjOdCHQSg170BiiKrU9EV5e5fyVkLmC', 'ADMIN');

-- Organizer: SuperNovaOL@mgm.org | SNorganizer123
INSERT IGNORE INTO users (id, name, email, password, role) VALUES
  (UUID(), 'Organizer User', 'SuperNovaOL@mgm.org',
   '$2y$10$Ib4Rw53G0SbbDNWuIP0h.eh8byNcCmRjwqSVOQvjWYAyDQqWqoHDu', 'ORGANIZER');

-- Finance: SuperNovaFL@mgm.org | SNfinance123
INSERT IGNORE INTO users (id, name, email, password, role) VALUES
  (UUID(), 'Finance User', 'SuperNovaFL@mgm.org',
   '$2y$10$si.07iYXDGAo/lsVIL4AyO388fEokV347Dmv6O8iilU8W.66q6FQe', 'FINANCE');

-- ─────────────────────────────────────────────────────────────────────────────
-- SECTION 6: POST-SEED UPDATES
-- ─────────────────────────────────────────────────────────────────────────────

-- Set banner image URLs for all events
UPDATE events SET bannerUrl = CONCAT('/assets/img/events/', title, '.png');

SET FOREIGN_KEY_CHECKS = 1;

-- =============================================================================
-- END OF database.sql
-- =============================================================================
