-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.prisma
51 lines (44 loc) · 1.02 KB
/
schema.prisma
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
datasource db {
provider = "postgres"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
model Post {
id String @id @default(uuid())
title String
text String
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
}
enum ShapeSizeEnum {
SMALL
MEDIUM
BIG
}
enum ShapeTypeEnum {
STAR
CIRCLE
RECTANGLE
}
model Shape {
id String @id @default(uuid())
x Int
y Int
size ShapeSizeEnum
type ShapeTypeEnum
color String
createdAt DateTime? @default(now())
updatedAt DateTime? @default(now()) @updatedAt
Draw Draw? @relation(fields: [drawId], references: [id], onDelete: Cascade, onUpdate: Cascade)
drawId String?
}
model Draw {
id String @id @default(uuid())
createdAt DateTime? @default(now())
userId String?
shapes Shape[]
}