mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-11-01 18:19:43 +00:00
Add streaks, scheduled releases, and notification settings
- Couple streaks with milestone notifications - Scheduled pack releases with admin UI - Notification preferences screen - Refactored profile settings screens - Partner activity notifications
This commit is contained in:
1 parent
12f312421b
commit
494ed17fe2
82 files changed
+4189
-725
No files matched your search
@@ -0,0 +1,25 @@
|
||||
-- Add scheduled pack release system
|
||||
-- Allows admins to schedule pack releases and automatically notifies users
|
||||
|
||||
-- Add scheduling columns to question_packs
|
||||
ALTER TABLE question_packs
|
||||
ADD COLUMN IF NOT EXISTS scheduled_release_at TIMESTAMPTZ,
|
||||
ADD COLUMN IF NOT EXISTS release_notified BOOLEAN DEFAULT false;
|
||||
|
||||
-- Index for efficient cron queries
|
||||
CREATE INDEX idx_question_packs_scheduled_release
|
||||
ON question_packs(scheduled_release_at)
|
||||
WHERE scheduled_release_at IS NOT NULL AND is_public = false;
|
||||
|
||||
-- Schedule cron job for processing scheduled releases (runs every 5 minutes)
|
||||
SELECT cron.schedule(
|
||||
'process-scheduled-releases',
|
||||
'*/5 * * * *',
|
||||
$$
|
||||
SELECT net.http_post(
|
||||
url := 'https://ckjcrkjpmhqhiucifukx.supabase.co/functions/v1/process-scheduled-releases',
|
||||
headers := jsonb_build_object('Content-Type', 'application/json'),
|
||||
body := '{}'::jsonb
|
||||
)
|
||||
$$
|
||||
);
|
||||
Reference in new issue
Block a user