mirror of
https://github.com/temetro/temetro.git
synced 2026-08-31 21:08:38 +00:00
backend: per-user settings store (/api/settings) + enable account deletion
- user_settings table (userId PK -> user, jsonb preferences) + migration - GET/PUT /api/settings (requireAuth, user-scoped; zod-validated flat map) - Better Auth user.deleteUser enabled so users can delete their own account Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
CREATE TABLE "user_settings" (
|
||||
"user_id" text PRIMARY KEY NOT NULL,
|
||||
"preferences" jsonb DEFAULT '{}'::jsonb NOT NULL,
|
||||
"updated_at" timestamp DEFAULT now() NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE "user_settings" ADD CONSTRAINT "user_settings_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;
|
||||
Reference in New Issue
Block a user