-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.prisma
96 lines (77 loc) · 1.99 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
model Continent {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
name String
code String @unique
countries Country[]
}
model Currency {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
code String @unique
name String
name_plural String
symbol String
symbol_native String
decimal_digits Int
rounding Int
countries Country[]
}
model Country {
id Int @id
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
name String
alpha2Code String
alpha3Code String
numberCode Int
nativeName String
continentCode String
capital String
phoneNumberCode String
currencyCode String?
timezone String[]
flag Flag?
states State[]
languages Language[]
currency Currency? @relation(fields: [currencyCode], references: [code])
continent Continent @relation(fields: [continentCode], references: [code])
}
model Flag {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
countryId Int @unique
emoji String
unicode String
image String
country Country @relation(fields: [countryId], references: [id])
}
model State {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
countryId Int
name String
country Country @relation(fields: [countryId], references: [id])
}
model Language {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
countryId Int
name String
ianaCode String
alpha2Code String
nativeName String
country Country @relation(fields: [countryId], references: [id])
}