-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema.dbml
96 lines (83 loc) · 1.5 KB
/
schema.dbml
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
enum affiliation {
ias
princeton
}
enum category {
accessories
"beauty supplies"
clothing
"dorm essentials"
"event tickets"
food
furniture
housing
other
"school supplies"
services
tech
textbooks
transportation
}
enum item_type {
sell
rent
}
enum quality {
new
"like new"
good
fair
poor
}
enum status {
active
inactive
sold
expired
}
table item_images {
id serial [pk, not null, increment]
item_id integer [not null]
url text [not null]
}
table items {
id serial [pk, not null, increment]
user_id text [not null]
time_posted timestamp [not null]
time_expire timestamp [not null]
name text [not null]
price numeric [not null]
quality quality
description text
status status [not null]
item_type item_type [not null]
category category [not null]
}
table request_images {
id serial [pk, not null, increment]
request_id integer [not null]
url text [not null]
}
table requests {
id serial [pk, not null, increment]
user_id integer [not null]
time_posted timestamp [not null]
time_expire timestamp [not null]
name text [not null]
price numeric [not null]
description text
category category [not null]
}
table user {
id serial [pk, not null, increment]
email text [not null]
name text [not null]
affiliation affiliation [not null]
age integer [not null]
text text
phone text
}
ref: item_images.item_id > items.id
ref: items.user_id > user.id
ref: request_images.request_id > requests.id
ref: requests.user_id > user.id