-- Add email preference columns to users table
ALTER TABLE users ADD COLUMN IF NOT EXISTS email_newsletter BOOLEAN DEFAULT false;
ALTER TABLE users ADD COLUMN IF NOT EXISTS email_contact BOOLEAN DEFAULT false;

-- Add indexes for performance if needed
CREATE INDEX IF NOT EXISTS idx_users_email_newsletter ON users(email_newsletter);
CREATE INDEX IF NOT EXISTS idx_users_email_contact ON users(email_contact);

-- Add comment for documentation
COMMENT ON COLUMN users.email_newsletter IS 'User has opted in to receive newsletter emails';
COMMENT ON COLUMN users.email_contact IS 'User has opted in to receive contact/transactional emails';
