-- ============================================================
-- FIX_admin_login_now.sql
-- Run this ONCE, right now, in phpMyAdmin. This is NOT part of
-- RUN_THIS_ALL_IN_ONE.sql on purpose - it's a one-time repair, not a
-- repeatable migration.
--
-- What happened: adding the new `email_verified` column defaulted every
-- EXISTING account (including your Admin login) to 'No', so the new
-- login-OTP system started asking pre-existing users to verify an email
-- they were never actually asked to verify in the first place - locking
-- everyone out, including Admin.
--
-- This marks every account that already existed before today as verified
-- (grandfathered in), and clears any stuck OTP left on your Admin row.
-- New signups going forward still go through real OTP verification as
-- intended - this only fixes accounts that were already there.
-- ============================================================

UPDATE `users`
SET `email_verified` = 'Yes',
    `otp_code` = NULL,
    `otp_expires_at` = NULL,
    `otp_purpose` = NULL
WHERE `email_verified` = 'No';
