-- Migration: Add phone verification fields to users table
-- Run this migration to add phone verification support

ALTER TABLE `users` 
ADD COLUMN `phoneVerificationOTP` VARCHAR(6) NULL AFTER `isEmailVerified`,
ADD COLUMN `phoneVerificationOTPExpiry` DATETIME NULL AFTER `phoneVerificationOTP`,
ADD COLUMN `isPhoneVerified` BOOLEAN DEFAULT FALSE AFTER `phoneVerificationOTPExpiry`;

-- Update existing users to have isPhoneVerified = false (if they don't have phone verified)
UPDATE `users` SET `isPhoneVerified` = FALSE WHERE `isPhoneVerified` IS NULL;

