diff options
Diffstat (limited to 'schema.sql')
-rw-r--r-- | schema.sql | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/schema.sql b/schema.sql new file mode 100644 index 0000000..61fdc45 --- /dev/null +++ b/schema.sql | |||
@@ -0,0 +1,32 @@ | |||
1 | CREATE TABLE `profiles` ( | ||
2 | `profile_id` INTEGER PRIMARY KEY, | ||
3 | `profile_path` VARCHAR(255) NOT NULL | ||
4 | ); | ||
5 | |||
6 | CREATE UNIQUE INDEX `profile_by_path` ON `profiles`(`profile_path`); | ||
7 | |||
8 | CREATE TABLE `games` ( | ||
9 | `game_id` INTEGER PRIMARY KEY, | ||
10 | `steam_appid` INTEGER NOT NULL, | ||
11 | `moon_image` VARCHAR(255) NOT NULL | ||
12 | ); | ||
13 | |||
14 | CREATE UNIQUE INDEX `game_by_appid` ON `games`(`steam_appid`); | ||
15 | |||
16 | CREATE TABLE `achievements` ( | ||
17 | `achievement_id` INTEGER PRIMARY KEY, | ||
18 | `game_id` INTEGER NOT NULL, | ||
19 | `title` VARCHAR(255) NOT NULL | ||
20 | ); | ||
21 | |||
22 | CREATE TABLE `dids` ( | ||
23 | `profile_id` INTEGER NOT NULL, | ||
24 | `achievement_id` INTEGER NOT NULL, | ||
25 | `achieved_at` DATETIME NOT NULL | ||
26 | ); | ||
27 | |||
28 | CREATE TABLE `images` ( | ||
29 | `image_id` INTEGER PRIMARY KEY, | ||
30 | `game_id` INTEGER NOT NULL, | ||
31 | `filename` VARCHAR(255) NOT NULL | ||
32 | ); | ||