-
Notifications
You must be signed in to change notification settings - Fork 0
Schema
Jonathan Calixto edited this page Sep 18, 2020
·
6 revisions
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
username | string | not null, indexed, unique |
string | not null, indexed, unique | |
password_digest | string | not null |
session_token | string | not null, 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 |
title | string | not null, indexed |
description | string | optional |
location | string | optional |
gallery_id | integer | optional |
photographer_id | integer | not null, indexed, foreign key |
created_at | datetime | not null |
updated_at | datetime | not null |
- index on title
- index on photographer_id
- photographer_id references users
- gallery_id references galleries
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
photographer_id | integer | not null, indexed, foreign_key |
follower_id | integer | not null, indexed, foreign key |
created_at | datetime | not null |
updated_at | datetime | not null |
- user_id references users
- follower_id references users
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
body | string | not null |
photo_id | integer | not null, indexed, foreign_key |
commenter_id | integer | not null, indexed, foreign key |
created_at | datetime | not null |
updated_at | datetime | not null |
- commenter_id references users
- photo_id references photos
- index on photo_id
- index on commenter_id
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
photo_id | integer | not null, indexed, foreign_key |
liker_id | integer | not null, indexed, foreign key |
created_at | datetime | not null |
updated_at | datetime | not null |
- photo_id references photos
- liker_id references users
- index on photo_id
- index on liker_id
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
category_name | string | not null |
created_at | datetime | not null |
updated_at | datetime | not null |
- photo_id references photos
- index on photo_id
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
photo_id | integer | not null, indexed, foreign key |
category_id | integer | not null, indexed, foreign key |
created_at | datetime | not null |
updated_at | datetime | not null |
- photo_id references photos
- category_id references categories
- index on photo_id
- index on category_id
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
photo_id | integer | not null, indexed, foreign key |
gallery_id | integer | not null, indexed, foreign key |
created_at | datetime | not null |
updated_at | datetime | not null |
- photo_id references photos
- gallery_id references galleries
- index on photo_id
- index on gallery_id
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
title | string | not null, indexed, unique |
owner_id | integer | not null, indexed, foreign key |
created_at | datetime | not null |
updated_at | datetime | not null |
- owner_id references users
- index on title, unique: true
- index on photo_id
- index on owner_id