wasp/waspc/examples/todoApp/migrations/20201028133236-init
2020-10-28 15:28:58 +01:00
..
README.md Fixed a bug with Prisma migrations. (#104) 2020-10-28 15:28:58 +01:00
schema.prisma Fixed a bug with Prisma migrations. (#104) 2020-10-28 15:28:58 +01:00
steps.json Fixed a bug with Prisma migrations. (#104) 2020-10-28 15:28:58 +01:00

Migration 20201028133236-init

This migration has been generated by Matija Sosic at 10/28/2020, 2:32:36 PM. You can check out the state of the schema after the migration.

Database Steps

CREATE TABLE "User" (
    "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
    "email" TEXT NOT NULL,
    "password" TEXT NOT NULL
)

CREATE TABLE "Task" (
    "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
    "description" TEXT NOT NULL,
    "isDone" BOOLEAN NOT NULL DEFAULT false,
    "userId" INTEGER NOT NULL,

    FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE
)

CREATE UNIQUE INDEX "User.email_unique" ON "User"("email")

Changes

diff --git schema.prisma schema.prisma
migration ..20201028133236-init
--- datamodel.dml
+++ datamodel.dml
@@ -1,0 +1,26 @@
+
+datasource db {
+  provider = "sqlite"
+  url = "***"
+}
+
+generator client {
+  provider = "prisma-client-js"
+  output = "../server/node_modules/.prisma/client"
+}
+
+model User {
+    id          Int     @id @default(autoincrement())
+    email       String  @unique
+    password    String
+    tasks       Task[]
+}
+
+model Task {
+    id          Int     @id @default(autoincrement())
+    description String
+    isDone      Boolean @default(false)
+    user        User    @relation(fields: [userId], references: [id])
+    userId      Int
+}
+