Database Setup - AnJuHyppolite/Capstone-Givn GitHub Wiki
( we will be using firebase for to keep track of users, emails and passwords. We will also use a local table for users for a few optional fields)
USERS:
| Column Name | Datatype | Constraints |
|---|---|---|
| VARCHAR(50) | unique | |
| display_name | VARCHAR(30) | |
| address | VARCHAR(100) | |
| score | INT | not null |
ITEMS:
| Column Name | Datatype | Constraints |
|---|---|---|
| title | VARCHAR(50) | not null |
| description | TEXT | not null |
| location | TEXT | not null |
| created_at | TEXT | not null |
| status | TEXT | not null |
| is_biodegradable | BOOLEAN | not null |
| expiration | INT | not null default 0 |
| giver_id | INT | f_key: ref (users.id) |
TRANSACTIONS:
| Column Name | Datatype | Constraints |
|---|---|---|
| time | TEXT | not null |
| getter_id | INT | f_key: ref (users.id) |
| giver_id | INT | f_key: ref (users.id) |
| item_id | INT | f_key: ref (items.id) |
CATEGORIES:
| Column Name | Datatype | Constraints |
|---|---|---|
| name | VARCHAR(30) | not null |
| points | INT | not null |
CATEGORY_ITEMS:
| Column Name | Datatype | Constraints |
|---|---|---|
| category_id | INT | f_key: ref (category.id) |
| item_id | INT | f_key: ref (item.id) |
PHOTOS:
| Column Name | Datatype | Constraints |
|---|---|---|
| photo_url | VARCHAR(50) | not null |
| item_id | INT | f_key: ref (items.id) |