Skip to content

Commit dbf9895

Browse files
committed
updates
1 parent 464f502 commit dbf9895

File tree

11 files changed

+126
-2095
lines changed

11 files changed

+126
-2095
lines changed

public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
-->
1111
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
1212
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
13-
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.2.1/css/tachyons.min.css"/>
13+
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.12.0/css/tachyons.min.css" />
1414
<!--
1515
Notice the use of %PUBLIC_URL% in the tags above.
1616
It will be replaced with the URL of the `public` folder during the build.

server/prisma/dev.db

4 KB
Binary file not shown.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Migration `20201015184854-useroptional`
2+
3+
This migration has been generated by Ryan Chenkie at 10/15/2020, 2:48:54 PM.
4+
You can check out the [state of the schema](./schema.prisma) after the migration.
5+
6+
## Database Steps
7+
8+
```sql
9+
PRAGMA foreign_keys=OFF;
10+
CREATE TABLE "new_Link" (
11+
"id" TEXT NOT NULL,
12+
"description" TEXT NOT NULL,
13+
"url" TEXT NOT NULL,
14+
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
15+
"userId" TEXT,
16+
17+
FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE,
18+
PRIMARY KEY ("id")
19+
);
20+
INSERT INTO "new_Link" ("id", "description", "url", "createdAt", "userId") SELECT "id", "description", "url", "createdAt", "userId" FROM "Link";
21+
DROP TABLE "Link";
22+
ALTER TABLE "new_Link" RENAME TO "Link";
23+
PRAGMA foreign_key_check;
24+
PRAGMA foreign_keys=ON
25+
```
26+
27+
## Changes
28+
29+
```diff
30+
diff --git schema.prisma schema.prisma
31+
migration 20201007154524-init..20201015184854-useroptional
32+
--- datamodel.dml
33+
+++ datamodel.dml
34+
@@ -2,9 +2,9 @@
35+
// learn more about it in the docs: https://pris.ly/d/prisma-schema
36+
datasource db {
37+
provider = "sqlite"
38+
- url = "***"
39+
+ url = "***"
40+
}
41+
generator client {
42+
provider = "prisma-client-js"
43+
@@ -14,11 +14,11 @@
44+
id String @id @default(cuid())
45+
description String
46+
url String
47+
createdAt DateTime @default(now())
48+
- postedBy User @relation(fields: [userId], references: [id])
49+
votes Vote[]
50+
- userId String
51+
+ postedBy User? @relation(fields: [userId], references: [id])
52+
+ userId String?
53+
}
54+
model User {
55+
id String @id @default(cuid())
56+
```
57+
58+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// This is your Prisma schema file,
2+
// learn more about it in the docs: https://pris.ly/d/prisma-schema
3+
4+
datasource db {
5+
provider = "sqlite"
6+
url = "***"
7+
}
8+
9+
generator client {
10+
provider = "prisma-client-js"
11+
}
12+
13+
model Link {
14+
id String @id @default(cuid())
15+
description String
16+
url String
17+
createdAt DateTime @default(now())
18+
votes Vote[]
19+
postedBy User? @relation(fields: [userId], references: [id])
20+
userId String?
21+
}
22+
23+
model User {
24+
id String @id @default(cuid())
25+
name String
26+
email String
27+
password String
28+
links Link[]
29+
votes Vote[]
30+
}
31+
32+
model Vote {
33+
id String @id @default(cuid())
34+
link Link @relation(fields: [linkId], references: [id])
35+
user User @relation(fields: [userId], references: [id])
36+
linkId String
37+
userId String
38+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"version": "0.3.14-fixed",
3+
"steps": [
4+
{
5+
"tag": "UpdateField",
6+
"model": "Link",
7+
"field": "postedBy",
8+
"arity": "Optional"
9+
},
10+
{
11+
"tag": "UpdateField",
12+
"model": "Link",
13+
"field": "userId",
14+
"arity": "Optional"
15+
}
16+
]
17+
}

server/prisma/migrations/migrate.lock

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# Prisma Migrate lockfile v1
22

3-
20201007154524-init
3+
20201007154524-init
4+
20201015184854-useroptional

server/prisma/schema.prisma

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ model Link {
1515
description String
1616
url String
1717
createdAt DateTime @default(now())
18-
postedBy User @relation(fields: [userId], references: [id])
1918
votes Vote[]
20-
userId String
19+
postedBy User? @relation(fields: [userId], references: [id])
20+
userId String?
2121
}
2222

2323
model User {

0 commit comments

Comments
 (0)