veza/veza-backend-api/migrations/093_notification_preferences.sql

14 lines
608 B
MySQL
Raw Normal View History

-- 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()
);