Files
BYW-VoiceHub/app/drizzle/migrations/20260212113037_add_user_identities_table.sql
Henry_Du 4ce4649aaf
Build VoiceHub FPK / build-fpk (push) Failing after 56m5s
Build and Push Docker Image / build-and-push (push) Canceled after 1h9m35s
初次提交
2026-09-06 08:19:02 +08:00

11 lines
517 B
SQL

CREATE TABLE "UserIdentity" (
"id" serial PRIMARY KEY NOT NULL,
"userId" integer NOT NULL,
"provider" text NOT NULL,
"providerUserId" text NOT NULL,
"providerUsername" text,
"createdAt" timestamp DEFAULT now() NOT NULL,
CONSTRAINT "UserIdentity_provider_providerUserId_unique" UNIQUE("provider","providerUserId")
);
--> statement-breakpoint
ALTER TABLE "UserIdentity" ADD CONSTRAINT "UserIdentity_userId_User_id_fk" FOREIGN KEY ("userId") REFERENCES "public"."User"("id") ON DELETE cascade ON UPDATE no action;