-- Add 2FA fields to users table
ALTER TABLE users
ADD COLUMN is_2fa_enabled BOOLEAN DEFAULT FALSE NOT NULL,
ADD COLUMN two_factor_enabled_at TIMESTAMPTZ DEFAULT NULL;

-- Create index on is_2fa_enabled for query performance
CREATE INDEX idx_users_is_2fa_enabled ON users (is_2fa_enabled);