-
Notifications
You must be signed in to change notification settings - Fork 0
Schema
grantpaulson6 edited this page Apr 28, 2019
·
13 revisions
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| username | text | not null, unique, indexed |
| password_digest | string | not null |
| session_token | string | not null |
| first_name | string | not null |
| last_name | string | not null |
| string | not null, unique, indexed | |
| gender | string | inclusion (male, female, other) |
| birthdate | date | |
| about | text | |
| created_at | datetime | not null |
| updated_at | datetime | not null |
- has_many bookings
- has_many nests through bookings
- has_many hosts through nests
- has_many listings
- has_many listing_bookings through listings
- has_many customers through listing_bookings
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| title | string | not null, unique, indexed |
| price | float | not null |
| description | text | |
| owner_id | integer | not null |
| max_guests | integer | |
| num_beds | integer | |
| num_bathrooms | integer | |
| street_address | string | |
| location | string | |
| zip_code | integer | |
| lat | float | |
| lon | float |
- has_many bookings
- belongs_to owner
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| listing_id | integer | not null |
| nomad_id | integer | not null |
| start_date | date | not null |
| end_date | date | not null |
- belongs_to listings
- belongs_to nomad
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| author_id | integer | not null |
| listing_id | integer | not null |
| score | integer | not null, inclusion (0, 1, 2, 3, 4, 5) |
| review | text | not null, min characters |
- combo index author_id/listing_id, unique true
- belongs_to author
- belongs_to listing