-
Notifications
You must be signed in to change notification settings - Fork 0
Schema
killacan edited this page Sep 6, 2022
·
1 revision
| column name | data type | details |
|---|---|---|
id |
Bigint | not null, primary key |
username |
String | not null, uniqueness true, indexed |
password_digest |
String | not null |
email |
String | not null, uniqueness true |
session_token |
String | not null, uniqueness true, indexed |
created_at |
Date | not null |
Updated_at |
Date | not null |
- index on
username, unique: true - index on
email, unique: true - index on
session_token, unique: true has_many gameshas_many reviews
| column name | data_type | validations |
|---|---|---|
id |
Bigint | not null, primary key |
game_name |
String | not null, uniqueness true, indexed |
uploader_id |
Bigint | not null |
created_at |
Date | not null |
Updated_at |
Date | not null |
- index on
game_name -
uploader_idreferencesusers has_many ownershas_many tags
| column name | data_type | validations |
|---|---|---|
id |
Bigint | not null, primary key |
body |
String | not null |
reviewer_id |
Bigint | not null, indexed |
created_at |
Date | not null |
Updated_at |
Date | not null |
-
reviewer_idreferencesusers belongs_to user
| column name | data_type | validations |
|---|---|---|
id |
Bigint | not null, primary key |
user_id |
Bigint | not null, indexed |
game_id |
Bigint | not null, indexed |
created_at |
Date | not null |
Updated_at |
Date | not null |
-
user_idreferencesusers -
game_idreferencesgames has_many usershas_many games
| column name | data_type | validations |
|---|---|---|
id |
Bigint | not null, primary key |
tag_id |
Bigint | not null, indexed |
game_id |
Bigint | not null, indexed |
created_at |
Date | not null |
Updated_at |
Date | not null |
-
tag_idreferencestags -
game_idreferencesgames belongs_to gamebelongs_to tag
| column name | data_type | validations |
|---|---|---|
id |
Bigint | not null, primary key |
tag |
string | not null, |
created_at |
Date | not null |
Updated_at |
Date | not null |
has_many games
| column name | data_type | validations |
|---|---|---|
id |
Bigint | not null, primary key |
user_id |
Bigint | not null, indexed |
game_id |
Bigint | not null, indexed |
created_at |
Date | not null |
Updated_at |
Date | not null |
-
user_idreferencesusers -
game_idreferencesgames belongs_to userbelongs_to game