-- Migration: Ensure all users have a entry in user_xp table
-- Created at: 2026-03-31

INSERT INTO user_xp (user_id, total_xp, monthly_xp, current_level, xp_to_next_level, streak_days)
SELECT id, 0, 0, 1, 100, 0 
FROM users
WHERE id NOT IN (SELECT user_id FROM user_xp);
