-
Notifications
You must be signed in to change notification settings - Fork 0
Database Schema
Kimi-Zou edited this page Dec 1, 2020
·
4 revisions
Schema for PostgresQL using Sequelize ORM
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| userName | string(255) | not null, unique |
| string(255) | not null, unique | |
| hashedPassword | string | not null |
| points | integer | not null, default 0 |
| createdAt | datetime | not null |
| updatedAt | datetime | not null |
- unique on
username - unique on
email - Sequelize
hasManyRewardsassociation - Sequelize
hasManyListsassociation
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| rewardName | string(255) | not null |
| rewardDescription | text | |
| rewardValue | integer | not null |
| isCollected | boolean | not null, default false |
| userId | integer | not null, foreign key |
| createdAt | datetime | not null |
| updatedAt | datetime | not null |
-
userIdreferencesUserstable - Sequelize
belongsToUsersassociation
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| listName | string(255) | not null |
| userId | integer | not null, foreign key |
| createdAt | datetime | not null |
| updatedAt | datetime | not null |
-
userIdreferencesUserstable - Sequelize
hasManyChoresassociation - Sequelize
belongsToUsersassociation
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| choreType | string(255) | not null |
| createdAt | datetime | not null |
| updatedAt | datetime | not null |
- Sequelize
hasManyChoresassociation
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| choreName | string(255) | not null |
| value | integer | not null |
| note | string(280) | |
| dueDate | date | |
| isCompleted | boolean | not null, default false |
| listId | integer | not null, foreign key |
| choreTypeId | integer | not null, foreign key |
| createdAt | datetime | not null |
| updatedAt | datetime | not null |
-
listIdreferencesListstable -
choreTypeIdreferencesChoreTypestable - Sequelize
belongsToListsassociation - Sequelize
belongsToChoreTypesassociation