aboutsummaryrefslogtreecommitdiff
path: root/supabase
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-03-28 06:20:36 +0000
committerFuwn <[email protected]>2026-03-28 06:20:36 +0000
commit78bf2502cbf1e26980abf6c0ffb7f0c74b917a3b (patch)
tree9f4a84c90fa7fcfa945f1c9e0e637ba80b9cca79 /supabase
parentfix(cache): preserve hydrated client state (diff)
downloaddue.moe-78bf2502cbf1e26980abf6c0ffb7f0c74b917a3b.tar.xz
due.moe-78bf2502cbf1e26980abf6c0ffb7f0c74b917a3b.zip
fix(notifications): support per-device push subscriptions
Diffstat (limited to 'supabase')
-rw-r--r--supabase/notifications.sql9
-rw-r--r--supabase/schema.sql5
2 files changed, 11 insertions, 3 deletions
diff --git a/supabase/notifications.sql b/supabase/notifications.sql
new file mode 100644
index 00000000..81905a29
--- /dev/null
+++ b/supabase/notifications.sql
@@ -0,0 +1,9 @@
+ALTER TABLE public.user_notifications
+ DROP CONSTRAINT IF EXISTS user_notifications_user_id_key;
+
+ALTER TABLE public.user_notifications
+ DROP CONSTRAINT IF EXISTS user_notifications_user_id_fingerprint_key;
+
+ALTER TABLE public.user_notifications
+ ADD CONSTRAINT user_notifications_user_id_fingerprint_key
+ UNIQUE (user_id, fingerprint);
diff --git a/supabase/schema.sql b/supabase/schema.sql
index 7648b7e4..9dc0934a 100644
--- a/supabase/schema.sql
+++ b/supabase/schema.sql
@@ -489,11 +489,11 @@ ALTER TABLE ONLY "public"."user_notifications"
--
--- Name: user_notifications user_notifications_user_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres
+-- Name: user_notifications user_notifications_user_id_fingerprint_key; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY "public"."user_notifications"
- ADD CONSTRAINT "user_notifications_user_id_key" UNIQUE ("user_id");
+ ADD CONSTRAINT "user_notifications_user_id_fingerprint_key" UNIQUE ("user_id", "fingerprint");
--
@@ -1481,4 +1481,3 @@ ALTER DEFAULT PRIVILEGES FOR ROLE "postgres" IN SCHEMA "public" GRANT SELECT,INS
--
-- \unrestrict ayCRchpk9QYAkH0FR7MzsPfEkgyq5Y02kQfarpa01RE4AwEybP0seWKhOVsHiST
-