-
Notifications
You must be signed in to change notification settings - Fork 1
Database Schema
Tommy Nienchi Chen edited this page Mar 30, 2021
·
5 revisions
Schema for PostgresQL using Sequelize ORM
| Attribute Name | Attribute Type | Constraints |
|---|---|---|
| id | int | not null, primary key |
| username | string | not null, unique, 20 chars or less |
| string | not null, unique, 255 chars or less | |
| hashedPassword | string | not null, STRING.BINARY |
| balance | numeric | not null |
| createdAt | datetime | not null |
| updatedAt | datetime | not null |
| Attribute Name | Attribute Type | Constraints |
|---|---|---|
| id | int | not null, primary key |
| initial_odds | numeric | not null |
| initial_amount | numeric | not null |
| current_amount | numeric | not null |
| initial_partial_fill_amount | numeric | not null |
| liquidityProviderBool | Boolean | not null |
| createdAt | datetime | not null |
| updatedAt | datetime | not null |
| created_by_user_id | int | foreignkey Users.id |
| Attribute Name | Attribute Type | Constraints |
|---|---|---|
| id | int | not null, primary key |
| amount | numeric | not null |
| matched_odds | numeric | not null |
| eventOverBool | Boolean | not null |
| paidOutBool | Boolean | not null |
| createdAt | datetime | not null |
| updatedAt | datetime | not null |
| liquidity_provider_wager_id | int | foreignkey Wagers.id |
| liquidity_remover_wager_id | int | foreignkey Wagers.id |
| event_prediction_id | int | foreignkey EventPredictions.id |
| Attribute Name | Attribute Type | Constraints |
|---|---|---|
| id | int | not null, primary key |
| api_id | int | not null |
| title | String | not null |
| game_api_json | TEXT | stringified JSON |
| categories | TEXT | stringified array |
| start_time | Datetime | |
| end_time | Datetime | |
| createdAt | datetime | not null |
| updatedAt | datetime | not null |
| Attribute Name | Attribute Type | Constraints |
|---|---|---|
| id | int | not null, primary key |
| current_odds | numeric | |
| prev_odds | numeric | |
| hasEndedBool | Boolean | not null |
| createdAt | datetime | not null |
| updatedAt | datetime | not null |
| event_id | int | foreignkey Events.id |