mirror of
https://github.com/temetro/temetro.git
synced 2026-07-26 11:58:14 +00:00
50fbb6cd40
- 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>
7 lines
368 B
SQL
7 lines
368 B
SQL
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; |