Skip to content

Commit 5693cce

Browse files
committed
create:<schema.prisma>(Create User, Product, Update schema)
1 parent c4ed804 commit 5693cce

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

prisma/schema.prisma

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// This is your Prisma schema file,
2+
// learn more about it in the docs: https://pris.ly/d/prisma-schema
3+
4+
generator client {
5+
provider = "prisma-client-js"
6+
}
7+
8+
datasource db {
9+
provider = "postgresql"
10+
url = env("DATABASE_URL")
11+
}
12+
13+
model User {
14+
id String @id @default(uuid())
15+
username String @unique
16+
password String
17+
createdAt DateTime @default(now())
18+
products Product[]
19+
}
20+
21+
model Product {
22+
id String @id @default(uuid())
23+
name String @db.VarChar(255)
24+
belongsToId String
25+
createdAt DateTime @default(now())
26+
27+
belongsTo User @relation(fields: [belongsToId], references: [id])
28+
update Update[]
29+
}
30+
31+
enum UPDATE_STATUS {
32+
IN_PROGRESS
33+
SHIPPED
34+
DEPRECATED
35+
}
36+
37+
model Update {
38+
id String @id @default(uuid())
39+
createdAt DateTime @default(now())
40+
updatedAt DateTime
41+
42+
title String
43+
body String
44+
status UPDATE_STATUS @default(IN_PROGRESS)
45+
version String?
46+
asset String?
47+
48+
productId String
49+
product Product @relation(fields: [productId], references: [id])
50+
updatepoint UpdatePoint[]
51+
}
52+
53+
model UpdatePoint {
54+
id String @id @default(uuid())
55+
createdAt DateTime @default(now())
56+
updatedAt DateTime
57+
58+
name String @db.VarChar(255)
59+
description String
60+
61+
updateId String
62+
update Update @relation(fields: [updateId], references: [id])
63+
}

0 commit comments

Comments
 (0)