-- Quick script to add credits for development/testing
-- Run this in Supabase SQL Editor

-- Add 1000 credits to all users (for development)
UPDATE user_credits 
SET balance = balance + 1000,
    updated_at = NOW()
WHERE user_id IN (
    SELECT id FROM auth.users
);

-- Or add credits to a specific user by email:
-- UPDATE user_credits 
-- SET balance = balance + 1000,
--     updated_at = NOW()
-- WHERE user_id = (
--     SELECT id FROM auth.users WHERE email = 'your-email@example.com'
-- );

SELECT 
    u.email,
    uc.balance,
    uc.updated_at
FROM user_credits uc
JOIN auth.users u ON u.id = uc.user_id
ORDER BY uc.updated_at DESC;
