Database Schema - acrks/rillow GitHub Wiki
users
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
email |
string | not null, indexed, unique |
password_digest |
string | not null |
session_token |
string | not null, indexed, unique |
created_at |
datetime | not null |
updated_at |
datetime | not null |
- index on
email, unique: true
- index on
session_token, unique: true
listings
column name | data type | details |
---|---|---|
id |
integer | not null, indexed, primary key |
creator |
integer | not null, foreign_key |
purchase |
boolean | not null |
price |
integer | not null |
num_bedrooms |
integer | not null |
num_bathrooms |
float | not null |
street_number |
integer | not null |
street_name |
string | not null |
city |
string | not null |
state |
string | not null |
zipcode |
integer | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
creator_id
referencesusers
- index on
listing, unique: true
likes
column name | data type | details |
---|---|---|
id |
integer | not null, indexed, primary key |
listing_id |
integer | not null, foreign key |
favoriter_id |
integer | not null, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
- index on
id, unique: true
favorite_id
referencesusers
listing_id
referenceslistings
tours
column name | data type | details |
---|---|---|
id |
integer | not null, indexed, primary key |
listing_id |
integer | not null, foreign key |
tourist_id |
integer | not null, foreign key |
agent_id |
integer | not null, foreign key |
tour_time |
datetime | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
listing_id
referenceslistings
tourist_id
referencesusers
agent_id
referencesusers