Compilations - cressie176/Load64 GitHub Wiki
┌───────────────────────────────┐
│ │
│ GameCompilation │
│ │
├───────────────────────────────┤
│ id: integer [pk] │
│ name: text [unique, required] │
└───────────────────────────────┘
┼
│
○
╱│╲
┌───────────────────────────────┐
│ │
│ GameCompilationEntry │
│ │
├───────────────────────────────┤
│ id: integer [pk] │
│ game_id: integer [fk] │
│ game_compilation_id: integer │
└───────────────────────────────┘
╲│╱
○
│
│
┼
┌───────────────────────────────┐
│ │
│ Game │
│ │
└───────────────────────────────┘
Compilations are user-defined named collections of games, used to organise and filter the library. A game may belong to zero or more compilations, and a compilation may contain zero or more games. Games within a compilation are sorted alphabetically by the game's sort_title.
In addition to user-defined compilations, LoadC64 provides a built-in "All Games" compilation which is computed dynamically and contains every game in the library. LoadC64 also maintains an "Untested Games" compilation: every imported game is automatically added to it, and the user removes games from it manually once satisfied they work correctly. Both names are reserved and cannot be used for user-defined compilations.
| Field | Type | PK | FK | Nullable | Unique | Description |
|---|---|---|---|---|---|---|
| id | integer | yes | Surrogate primary key. | |||
| name | text | yes | Human-readable display name (e.g. "Favourites"). Must not be "All Games" or "Untested Games". |
| Field | Type | PK | FK | Nullable | Unique | Description |
|---|---|---|---|---|---|---|
| id | integer | yes | Surrogate primary key. | |||
| game_id | integer | Game.id | 1 | Reference to the game. | ||
| game_compilation_id | integer | GameCompilation.id | 1 | Reference to the compilation. |
game_compilation
| id | name |
|---|---|
| 1 | Favourites |
| 2 | Multiplayer |
| 3 | New |
game_game_compilation
| game_id | game_compilation_id |
|---|---|
| 1 | 1 |
| 2 | 1 |
| 3 | 1 |
| 4 | 2 |
| 2 | 2 |