feat(consent): user_terms_consents + /v1/me/consent

This commit is contained in:
Sven (AAMOS AI)
2026-08-13 02:06:44 +07:00
parent 1df3ca1709
commit 61c3193f17
8 changed files with 10534 additions and 1 deletions
@@ -0,0 +1,20 @@
CREATE TABLE "gemini_usage" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"task_type" text NOT NULL,
"prompt_tokens" integer,
"output_tokens" integer,
"total_tokens" integer,
"cost_microcents" bigint
);
--> statement-breakpoint
CREATE TABLE "user_terms_consents" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"user_id" uuid NOT NULL,
"terms_version" text NOT NULL,
"accepted_at" timestamp with time zone DEFAULT now() NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "user_terms_consents" ADD CONSTRAINT "user_terms_consents_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE UNIQUE INDEX "user_terms_consents_user_version_unique" ON "user_terms_consents" USING btree ("user_id","terms_version");
File diff suppressed because it is too large Load Diff
@@ -183,6 +183,13 @@
"when": 1786397281333,
"tag": "0026_s5_onboarding_memory",
"breakpoints": true
},
{
"idx": 26,
"version": "7",
"when": 1786561534897,
"tag": "0026_light_infant_terrible",
"breakpoints": true
}
]
}