Files
cadhub/api/prisma/migrations/20201011043647-create-parts/README.md
2020-10-11 19:41:48 +11:00

53 lines
1.2 KiB
Markdown

# Migration `20201011043647-create-parts`
This migration has been generated by Kurt Hutten at 10/11/2020, 3:36:47 PM.
You can check out the [state of the schema](./schema.prisma) after the migration.
## Database Steps
```sql
CREATE TABLE "Part" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"title" TEXT NOT NULL,
"description" TEXT NOT NULL,
"mainImage" TEXT NOT NULL,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
)
```
## Changes
```diff
diff --git schema.prisma schema.prisma
migration 20201009213512-create-posts..20201011043647-create-parts
--- datamodel.dml
+++ datamodel.dml
@@ -1,9 +1,9 @@
datasource DS {
// optionally set multiple providers
// example: provider = ["sqlite", "postgresql"]
provider = "sqlite"
- url = "***"
+ url = "***"
}
generator client {
provider = "prisma-client-js"
@@ -15,4 +15,14 @@
title String
body String
createdAt DateTime @default(now())
}
+
+model Part {
+ id Int @id @default(autoincrement())
+ title String
+ description String // markdown string
+ mainImage String // link to cloudinary
+ createdAt DateTime @default(now())
+ // userId
+ //likes, comments, reactions
+}
```