-
Notifications
You must be signed in to change notification settings - Fork 1
Database Schema
Cynthia Ma edited this page Feb 4, 2018
·
16 revisions
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
username |
string | not null, indexed, unique |
email |
string | not null, indexed, unique |
img_url |
string | |
password_digest |
string | not null |
session_token |
string | not null, indexed, unique |
created_at |
datetime | not null |
updated_at |
datetime | not null |
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
title |
string | not null, indexed |
author_id |
integer | not null, indexed, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
author_idreferencesusers
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
question |
string | not null |
answer |
text | not null |
deck_id |
integer | not null, indexed, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
deck_idreferencesdeck
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| name | string | not null, indexed |
| created_at | datetime | not null |
| updated_at | datetime | not null |
post_tags is a joins table between deck and tag. A deck can have multiple tags.
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| deck_id | integer | not null, indexed, foreign key |
| tag_id | integer | not null, indexed, foreign key |
| created_at | datetime | not null |
| updated_at | datetime | not null |
-
deck_idreferencesdeck -
tag_idreferencestag