mirror of
https://github.com/aditama-labs/nest-autocrud.git
synced 2024-11-24 12:56:22 +00:00
12 lines
353 B
SQL
12 lines
353 B
SQL
-- CreateTable
|
|
CREATE TABLE "todo" (
|
|
"id" UUID NOT NULL DEFAULT gen_random_uuid(),
|
|
"name" TEXT NOT NULL,
|
|
"user_id" UUID NOT NULL,
|
|
|
|
CONSTRAINT "todo_pkey" PRIMARY KEY ("id")
|
|
);
|
|
|
|
-- AddForeignKey
|
|
ALTER TABLE "todo" ADD CONSTRAINT "todo_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "account"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|