To enable the automatic upvote tracking feature, you need to run a one-time database migration. Follow these simple steps:
Go to your Supabase Dashboard and click on "SQL Editor" in the left sidebar.
Click the button below to copy the SQL migration to your clipboard.
-- Add last_upvote_check column to submissions table
ALTER TABLE submissions ADD COLUMN IF NOT EXISTS last_upvote_check TIMESTAMP WITH TIME ZONE;
-- Create index for efficient querying
CREATE INDEX IF NOT EXISTS idx_submissions_last_upvote_check ON submissions(last_upvote_check);
-- Update existing submissions to have a default value
UPDATE submissions
SET last_upvote_check = submitted_at
WHERE last_upvote_check IS NULL AND submitted_at IS NOT NULL;Paste the SQL into the SQL Editor and click "Run" or press Ctrl+Enter.
Return to your dashboard and the upvote tracking will work smoothly. The system will automatically refresh upvotes every 15 minutes.
Once you run this migration, you'll never need to do it again. The upvote tracking feature will work automatically for all your submissions.