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
@@ -6,21 +6,17 @@ CREATE TABLE match_archives (
|
||||
user_id UUID NOT NULL REFERENCES auth.users(id) ON DELETE CASCADE,
|
||||
archived_at TIMESTAMPTZ DEFAULT now(),
|
||||
UNIQUE(match_id, user_id)
|
||||
);
|
||||
|
||||
);
|
||||
-- Index for efficient lookup when filtering matches
|
||||
CREATE INDEX idx_match_archives_user_match ON match_archives(user_id, match_id);
|
||||
|
||||
CREATE INDEX idx_match_archives_user_match ON match_archives(user_id, match_id);
|
||||
-- Enable RLS on match_archives
|
||||
ALTER TABLE match_archives ENABLE ROW LEVEL SECURITY;
|
||||
|
||||
ALTER TABLE match_archives ENABLE ROW LEVEL SECURITY;
|
||||
-- RLS Policies for match_archives
|
||||
|
||||
-- Users can view their own archives (needed for filtering)
|
||||
CREATE POLICY "Users can view own archives"
|
||||
ON match_archives FOR SELECT
|
||||
USING (user_id = auth.uid());
|
||||
|
||||
USING (user_id = auth.uid());
|
||||
-- Users can insert their own archives (for matches in their couples)
|
||||
CREATE POLICY "Users can archive matches"
|
||||
ON match_archives FOR INSERT
|
||||
@@ -32,15 +28,12 @@ CREATE POLICY "Users can archive matches"
|
||||
WHERE m.id = match_archives.match_id
|
||||
AND p.id = auth.uid()
|
||||
)
|
||||
);
|
||||
|
||||
);
|
||||
-- Users can delete their own archives (for unarchiving)
|
||||
CREATE POLICY "Users can unarchive matches"
|
||||
ON match_archives FOR DELETE
|
||||
USING (user_id = auth.uid());
|
||||
|
||||
USING (user_id = auth.uid());
|
||||
-- Add to realtime for live updates
|
||||
ALTER PUBLICATION supabase_realtime ADD TABLE match_archives;
|
||||
|
||||
ALTER PUBLICATION supabase_realtime ADD TABLE match_archives;
|
||||
-- Documentation
|
||||
COMMENT ON TABLE match_archives IS 'Per-user match archives. Partner still sees the match. Delete record to unarchive.';
|
||||
COMMENT ON TABLE match_archives IS 'Per-user match archives. Partner still sees the match. Delete record to unarchive.';
|
||||
Reference in new issue
Block a user