-- Add status and admin_notes to submissions
ALTER TABLE `submissions` ADD COLUMN IF NOT EXISTS `status` ENUM('pending', 'approved', 'rejected') DEFAULT 'pending' AFTER `is_verified`;
ALTER TABLE `submissions` ADD COLUMN IF NOT EXISTS `admin_notes` TEXT DEFAULT NULL;

-- Ensure users table has role and is_verified
ALTER TABLE `users` ADD COLUMN IF NOT EXISTS `role` ENUM('member', 'admin') DEFAULT 'member' AFTER `email`;
ALTER TABLE `users` ADD COLUMN IF NOT EXISTS `is_verified` TINYINT(1) DEFAULT 0 AFTER `role`;

-- Update existing verified submissions to 'approved' status
UPDATE `submissions` SET `status` = 'approved' WHERE `is_verified` = 1 AND `status` = 'pending';
