Files
Sauci/apps/api/drizzle/0005_profile_settings.sql
T
jjbrunton 006761d3b0 feat(backend): add standalone data plane
Replace the Supabase application data plane with the Node/PostgreSQL API, migrate mobile, admin, web, and MCP callers, add controlled cutover tooling, and define hardened Dokploy infrastructure.
2026-08-28 14:42:11 +01:00

36 lines
1.5 KiB
SQL

ALTER TABLE profiles
ADD COLUMN IF NOT EXISTS usage_reason text,
ADD COLUMN IF NOT EXISTS last_active_at timestamptz;
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS notification_preferences (
user_id uuid PRIMARY KEY REFERENCES profiles(id) ON DELETE CASCADE,
matches_enabled boolean NOT NULL DEFAULT true,
messages_enabled boolean NOT NULL DEFAULT true,
partner_activity_enabled boolean NOT NULL DEFAULT true,
nudges_enabled boolean NOT NULL DEFAULT true,
pack_changes_enabled boolean NOT NULL DEFAULT true,
new_packs_enabled boolean NOT NULL DEFAULT true,
streak_milestones_enabled boolean NOT NULL DEFAULT true,
weekly_summary_enabled boolean NOT NULL DEFAULT true,
unpaired_reminders_enabled boolean NOT NULL DEFAULT true,
catchup_reminders_enabled boolean NOT NULL DEFAULT true,
created_at timestamptz NOT NULL DEFAULT now(),
updated_at timestamptz NOT NULL DEFAULT now()
);
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS feedback (
id uuid PRIMARY KEY,
user_id uuid NOT NULL REFERENCES profiles(id) ON DELETE CASCADE,
type text NOT NULL CHECK (type IN ('bug', 'feature_request', 'general', 'question')),
title text NOT NULL,
description text NOT NULL,
device_info jsonb NOT NULL DEFAULT '{}'::jsonb,
status text NOT NULL DEFAULT 'new' CHECK (status IN ('new', 'reviewed', 'in_progress', 'resolved', 'closed')),
question_id uuid,
created_at timestamptz NOT NULL DEFAULT now(),
updated_at timestamptz NOT NULL DEFAULT now()
);
--> statement-breakpoint
CREATE INDEX IF NOT EXISTS feedback_user_id_idx ON feedback(user_id);