-- =============================================
-- Migration: Add admin role to users table
-- Run this in phpMyAdmin or MySQL command line
-- =============================================

-- Step 1: Add 'role' column to users table
ALTER TABLE `users`
  ADD COLUMN `role` ENUM('customer', 'admin') NOT NULL DEFAULT 'customer' AFTER `email`;

-- Step 2: Insert the admin user (password = Admin@123)
INSERT INTO `users` (`full_name`, `phone_number`, `email`, `role`, `password`) VALUES
('GP Admin', '9999999999', 'admin@gpcrackers.com', 'admin', '$2y$10$8eWZN3J1XVFcMrX2kY4sAupWoE1FqFpSK2UZO6QHHvNBiG/lZk8xW');

-- Note: The hash above corresponds to password "Admin@123"
-- You can regenerate using: password_hash('Admin@123', PASSWORD_DEFAULT)
