-
Notifications
You must be signed in to change notification settings - Fork 0
Database Schema
Daniel Upchurch edited this page Feb 19, 2021
·
5 revisions
Schema for PostgresQL
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
username |
string | not null, indexed, unique |
email |
string | not null, indexed, unique |
phoneNumber |
integer | |
hashedPassword |
string | not null |
firstName |
string | not null |
lastName |
string | not null |
isOrg |
boolean | default false |
createdAt |
datetime | not null |
updatedAt |
datetime | not null |
- unique index on
username
- unique index on
email
- User
belongsToMany
Resources
throughClaim-Status
- User
hasMany
Resources
association on posterID
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
posterId |
integer | not null, foreign key |
name |
string | not null |
description |
text | not null |
image |
string | |
quantity |
integer | not null |
catName |
string | not null |
startsAt |
date | not null |
endsAt |
date | not null |
locationId |
integer | not null, foreign key |
createdAt |
datetime | not null |
updatedAt |
datetime | not null |
- Resource
belongsTo
User
onposterId
- Resource
belongsToMany
Users
throughClaim-Status
- Resource
belongsTo
Location
onlocationId
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
state |
string | not null |
city |
string | not null |
latitude |
decimal | not null |
longitude |
decimal | not null |
createdAt |
datetime | not null |
updatedAt |
datetime | not null |
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
claimUserId |
integer | not null, foreign key |
resourceId |
integer | not null, foreign key |
quantitiy |
integer | not null |