i think i added push notifications to backend but im going to sleep now and ill finish frontend later

This commit is contained in:
2026-06-02 00:47:47 +02:00
parent 4db77055ed
commit a9278b8269
10 changed files with 255 additions and 38 deletions
+26
View File
@@ -55,6 +55,32 @@ CREATE TABLE IF NOT EXISTS public.users
CONSTRAINT unique_email UNIQUE (email)
);
CREATE TABLE IF NOT EXISTS public.device_tokens
(
id uuid NOT NULL DEFAULT uuid_generate_v4(),
user_id uuid NOT NULL,
fcm_token text NOT NULL,
updated_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT device_tokens_pkey PRIMARY KEY (id),
CONSTRAINT fk_device_tokens_user
FOREIGN KEY (user_id)
REFERENCES public.users(id)
ON DELETE CASCADE,
CONSTRAINT uq_device_tokens_fcm_token
UNIQUE (fcm_token)
);
CREATE INDEX idx_device_tokens_user_id
ON public.device_tokens(user_id);
ALTER TABLE IF EXISTS public.alt_subject
ADD CONSTRAINT alt_subject_subject_id_fkey FOREIGN KEY (subject_id)
REFERENCES public.subjects (id) MATCH SIMPLE