18+ tag, fixes

This commit is contained in:
Natsumi
2024-12-05 07:46:45 +13:00
parent e58ed54448
commit f49a3a1995
4 changed files with 12 additions and 2 deletions

View File

@@ -8,6 +8,10 @@ class Database {
async initUserTables(userId) {
Database.userId = userId;
Database.userPrefix = userId.replaceAll('-', '').replaceAll('_', '');
// Fix escape, add underscore if prefix starts with a number
if (Database.userPrefix.match(/^\d/)) {
Database.userPrefix = '_' + Database.userPrefix;
}
await sqliteService.executeNonQuery(
`CREATE TABLE IF NOT EXISTS ${Database.userPrefix}_feed_gps (id INTEGER PRIMARY KEY, created_at TEXT, user_id TEXT, display_name TEXT, location TEXT, world_name TEXT, previous_location TEXT, time INTEGER, group_name TEXT)`
);