Emoji manager

This commit is contained in:
Natsumi
2023-06-25 02:32:29 +12:00
parent 7a0b674bc8
commit 62e350cc91
6 changed files with 150 additions and 7 deletions

View File

@@ -45,7 +45,7 @@ class Database {
async initTables() {
await sqliteService.executeNonQuery(
`CREATE TABLE IF NOT EXISTS gamelog_location (id INTEGER PRIMARY KEY, created_at TEXT, location TEXT, world_id TEXT, world_name TEXT, time INTEGER, groupName TEXT, UNIQUE(created_at, location))`
`CREATE TABLE IF NOT EXISTS gamelog_location (id INTEGER PRIMARY KEY, created_at TEXT, location TEXT, world_id TEXT, world_name TEXT, time INTEGER, group_name TEXT, UNIQUE(created_at, location))`
);
await sqliteService.executeNonQuery(
`CREATE TABLE IF NOT EXISTS gamelog_join_leave (id INTEGER PRIMARY KEY, created_at TEXT, type TEXT, display_name TEXT, location TEXT, user_id TEXT, time INTEGER, UNIQUE(created_at, type, display_name))`
@@ -2275,6 +2275,19 @@ class Database {
);
}
}
// Fix gamelog_location column typo
try {
await sqliteService.executeNonQuery(
`SELECT groupName FROM gamelog_location LIMIT 1`
);
await sqliteService.executeNonQuery(
`ALTER TABLE gamelog_location DROP COLUMN groupName`
);
} catch (e) {
if (e.indexOf('no such column') === -1) {
throw e;
}
}
}
}