-
Notifications
You must be signed in to change notification settings - Fork 0
Database Schema
malikmoss edited this page Mar 29, 2021
·
3 revisions
Welcome to the McFlicc-Project wiki!
McFlicc is a 'Flickr' clone, dedicated to posting pictures of non-traditional McDonald's around the world.
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
username |
string | not null, indexed, unique |
email |
string | not null, indexed, unique |
hashedPassword |
string | not null |
createdAt |
datetime | not null |
updatedAt |
datetime | not null |
- unique index on
username - unique index on
email - Sequelize
hasManyPhotosassociation - Sequelize
hasManyCommentsassociation
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
photo |
image | not null |
albumId |
integer | not null |
userId |
integer | not null, indexed, foreign key |
createdAt |
datetime | not null |
updatedAt |
datetime | not null |
-
userIdreferencesUserstable - index on
authorId - Sequelize
belongsToUsersassociation - Sequelize
hasManyTagsassociation
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
name |
varcahr | not null |
userId |
integer | not null, indexed, foreign key |
createdAt |
datetime | not null |
updatedAt |
datetime | not null |
-
userIdreferencesUserstable - unique index on
[photoId, userId] - Sequelize
belongsToUsersassociation - Sequelize
hasManyPhotosassociation
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
type |
varcahr | not null |
createdAt |
datetime | not null |
updatedAt |
datetime | not null |
- Sequelize
belongsToPhotosassociation
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
photoId |
integer | not null, indexed, foreign key |
userId |
integer | not null, indexed, foreign key |
body |
string | not null |
createdAt |
datetime | not null |
updatedAt |
datetime | not null |
-
photoIdreferencesPhotostable -
userIdreferencesUserstable - Sequelize
belongsTophotoId association - Sequelize
belongsTouserIdassociation
| column name | data type | details |
|---|---|---|
photoId |
integer | not null, primary key |
tagId |
integer | not null, indexed, foreign key |
createdAt |
datetime | not null |
updatedAt |
datetime | not null |