mirror of
https://github.com/aditama-labs/nest-autocrud.git
synced 2024-11-22 03:16:21 +00:00
12 lines
353 B
MySQL
12 lines
353 B
MySQL
|
-- 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;
|