-
Notifications
You must be signed in to change notification settings - Fork 0
Database Schema
junnac edited this page Nov 5, 2019
·
14 revisions
Column Name | Data Type | Details |
---|---|---|
id |
integer | not null, primary key |
username |
string | not null, indexed, unique |
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
username, unique: true
- index on
email, unique: true
- index on
session_token, unique: true
Column Name | Data Type | Details |
---|---|---|
id |
integer | not null, primary key |
name |
string | not null, indexed, unique |
state |
string | not null, indexed |
created_at |
datetime | not null |
updated_at |
datetime | not null |
- index on
name, unique: true
- index on
state
Column Name | Data Type | Details |
---|---|---|
id |
integer | not null, primary key |
name |
string | not null, indexed, unique |
lat |
float | not null |
lng |
float | not null |
address |
string | not null |
website |
string | not null |
description |
text | |
city_id |
integer | not null, indexed, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
city_id
referencescities
- index on
name, unique: true
Column Name | Data Type | Details |
---|---|---|
id |
integer | not null, primary key |
title |
string | not null, indexed, unique |
body |
text | not null |
city_id |
integer | not null, indexed, unique, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
city_id
referencescities
- index on
title, unique: true
Column Name | Data Type | Details |
---|---|---|
id |
integer | not null, primary key |
brewery_id |
integer | not null, indexed, unique, foreign key |
guide_id |
integer | not null, indexed, unique, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
brewery_id
referencesbreweries
-
guide_id
referencesguides
Column Name | Data Type | Details |
---|---|---|
id |
integer | not null, primary key |
user_id |
integer | not null, indexed, unique, foreign key |
brewery_id |
integer | not null, indexed, unique, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
user_id
referencesusers
-
brewery_id
referencesbreweries