veza/veza-backend-api/migrations/093_notification_preferences.sql
senke 49e3122e78 feat(notifications): N1.1-N1.3 Web Push subscription, send on events, preferences
- N1.1: POST /notifications/push/subscribe, PushService, migration 090
- N1.2: Send Web Push on follow/like/comment/message via CreateNotification
- N1.3: GET/PUT /notifications/preferences, migration 093
- Shared NotificationService with PushService for profile, track, comment handlers
- Fix MockSocialService GetGlobalFeed, GetTrendingHashtags for tests
2026-02-21 16:41:39 +01:00

13 lines
608 B
SQL

-- Migration 093: Notification preferences for Web Push (v0.302 Lot N1.3)
-- User preferences for which notification types trigger browser push
CREATE TABLE IF NOT EXISTS notification_preferences (
user_id UUID PRIMARY KEY REFERENCES users(id) ON DELETE CASCADE,
push_follow BOOLEAN NOT NULL DEFAULT true,
push_like BOOLEAN NOT NULL DEFAULT true,
push_comment BOOLEAN NOT NULL DEFAULT true,
push_message BOOLEAN NOT NULL DEFAULT true,
push_mention BOOLEAN NOT NULL DEFAULT true,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);