-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from chenkie/update-prisma
update prisma to 2.12
- Loading branch information
Showing
21 changed files
with
3,785 additions
and
753 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
.env* | ||
dist | ||
package-lock.json | ||
node_modules | ||
.idea | ||
.vscode | ||
*.log | ||
*.log | ||
.DS_Store |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# Migration `20201125185150-init` | ||
|
||
This migration has been generated by Ryan Chenkie at 11/25/2020, 1:51:50 PM. | ||
You can check out the [state of the schema](./schema.prisma) after the migration. | ||
|
||
## Database Steps | ||
|
||
```sql | ||
CREATE TABLE "Link" ( | ||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"description" TEXT NOT NULL, | ||
"url" TEXT NOT NULL, | ||
"postedById" INTEGER NOT NULL, | ||
|
||
FOREIGN KEY ("postedById") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE | ||
) | ||
|
||
CREATE TABLE "User" ( | ||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||
"name" TEXT NOT NULL, | ||
"email" TEXT NOT NULL, | ||
"password" TEXT NOT NULL | ||
) | ||
|
||
CREATE TABLE "Vote" ( | ||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||
"linkId" INTEGER NOT NULL, | ||
"userId" INTEGER NOT NULL, | ||
|
||
FOREIGN KEY ("linkId") REFERENCES "Link"("id") ON DELETE CASCADE ON UPDATE CASCADE, | ||
FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE | ||
) | ||
|
||
CREATE UNIQUE INDEX "User.email_unique" ON "User"("email") | ||
|
||
CREATE UNIQUE INDEX "Vote.linkId_userId_unique" ON "Vote"("linkId", "userId") | ||
``` | ||
|
||
## Changes | ||
|
||
```diff | ||
diff --git schema.prisma schema.prisma | ||
migration ..20201125185150-init | ||
--- datamodel.dml | ||
+++ datamodel.dml | ||
@@ -1,0 +1,37 @@ | ||
+datasource db { | ||
+ provider = "sqlite" | ||
+ url = "***" | ||
+} | ||
+ | ||
+generator client { | ||
+ provider = "prisma-client-js" | ||
+} | ||
+ | ||
+model Link { | ||
+ id Int @id @default(autoincrement()) | ||
+ createdAt DateTime @default(now()) | ||
+ description String | ||
+ url String | ||
+ postedBy User @relation(fields: [postedById], references: [id]) | ||
+ postedById Int | ||
+ votes Vote[] | ||
+} | ||
+ | ||
+model User { | ||
+ id Int @id @default(autoincrement()) | ||
+ name String | ||
+ email String @unique | ||
+ password String | ||
+ links Link[] | ||
+ votes Vote[] | ||
+} | ||
+ | ||
+model Vote { | ||
+ id Int @id @default(autoincrement()) | ||
+ link Link @relation(fields: [linkId], references: [id]) | ||
+ linkId Int | ||
+ user User @relation(fields: [userId], references: [id]) | ||
+ userId Int | ||
+ | ||
+ @@unique([linkId, userId]) | ||
+} | ||
``` | ||
|
||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
# IF THERE'S A GIT CONFLICT IN THIS FILE, DON'T SOLVE IT MANUALLY! | ||
# INSTEAD EXECUTE `prisma migrate fix` | ||
# Prisma Migrate lockfile v1 | ||
# Read more about conflict resolution here: TODO | ||
|
||
20200415162823-init | ||
20200415170029 | ||
20201125185150-init |
Oops, something went wrong.