mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-05-24 01:00:49 +00:00
Move to SQLite (#13)
This commit is contained in:
parent
750ddb7762
commit
1799b70bc1
50 changed files with 2122 additions and 394 deletions
12
youmubot-db-sql/migrations/20210329111010_osu_users.sql
Normal file
12
youmubot-db-sql/migrations/20210329111010_osu_users.sql
Normal file
|
@ -0,0 +1,12 @@
|
|||
-- Add migration script here
|
||||
|
||||
CREATE TABLE osu_users (
|
||||
user_id BIGINT NOT NULL PRIMARY KEY,
|
||||
id BIGINT NOT NULL UNIQUE,
|
||||
last_update DATETIME NOT NULL,
|
||||
pp_std REAL NULL,
|
||||
pp_taiko REAL NULL,
|
||||
pp_mania REAL NULL,
|
||||
pp_catch REAL NULL,
|
||||
failures INT NOT NULL DEFAULT 0
|
||||
);
|
45
youmubot-db-sql/migrations/20210331094454_more_osu.sql
Normal file
45
youmubot-db-sql/migrations/20210331094454_more_osu.sql
Normal file
|
@ -0,0 +1,45 @@
|
|||
-- Add migration script here
|
||||
|
||||
CREATE TABLE osu_last_beatmaps (
|
||||
channel_id BIGINT NOT NULL PRIMARY KEY,
|
||||
beatmap BLOB NOT NULL,
|
||||
mode INT NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE osu_user_best_scores (
|
||||
beatmap_id BIGINT NOT NULL,
|
||||
mode INT NOT NULL,
|
||||
user_id INT NOT NULL REFERENCES osu_users(user_id) ON DELETE CASCADE,
|
||||
mods BIGINT NOT NULL,
|
||||
|
||||
cached_at DATETIME NOT NULL,
|
||||
score BLOB NOT NULL,
|
||||
|
||||
PRIMARY KEY (beatmap_id, mode, user_id, mods)
|
||||
);
|
||||
|
||||
CREATE TABLE osu_cached_beatmaps (
|
||||
beatmap_id BIGINT NOT NULL,
|
||||
mode INT NOT NULL,
|
||||
|
||||
cached_at DATETIME NOT NULL,
|
||||
beatmap BLOB NOT NULL,
|
||||
|
||||
PRIMARY KEY (beatmap_id, mode)
|
||||
);
|
||||
|
||||
CREATE TABLE osu_cached_beatmapsets (
|
||||
beatmapset_id BIGINT NOT NULL,
|
||||
beatmap_id BIGINT NOT NULL,
|
||||
mode INT NOT NULL,
|
||||
|
||||
PRIMARY KEY (beatmapset_id, beatmap_id, mode),
|
||||
FOREIGN KEY (beatmap_id, mode) REFERENCES osu_cached_beatmaps (beatmap_id, mode)
|
||||
);
|
||||
|
||||
CREATE TABLE osu_cached_beatmap_contents (
|
||||
beatmap_id BIGINT NOT NULL PRIMARY KEY,
|
||||
|
||||
cached_at DATETIME NOT NULL,
|
||||
content BLOB NOT NULL
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue