Files
open-saas/opensaas-sh/app_diff/migrations/20240105224550_tasks/migration.sql.diff
Martin Šošić 04553cd60c All in dirs (#154)
* Split the project into template and opensaas-sh (demo app (diff) + docs).

* fix
2024-06-04 13:24:32 +02:00

18 lines
639 B
Diff

--- template/app/migrations/20240105224550_tasks/migration.sql
+++ opensaas-sh/app/migrations/20240105224550_tasks/migration.sql
@@ -0,0 +1,14 @@
+-- CreateTable
+CREATE TABLE "Task" (
+ "id" TEXT NOT NULL,
+ "description" TEXT NOT NULL,
+ "time" TEXT NOT NULL DEFAULT '1',
+ "isDone" BOOLEAN NOT NULL DEFAULT false,
+ "userId" INTEGER NOT NULL,
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
+
+ CONSTRAINT "Task_pkey" PRIMARY KEY ("id")
+);
+
+-- AddForeignKey
+ALTER TABLE "Task" ADD CONSTRAINT "Task_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;