You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/database/Database.js
+51Lines changed: 51 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,9 @@ class Database {
13
13
this.sql.prepare('CREATE TABLE IF NOT EXISTS emoji_uses (emoji_id TEXT PRIMARY KEY, count INTEGER NOT NULL);').run();
14
14
this.sql.prepare('CREATE UNIQUE INDEX IF NOT EXISTS idx_emoji_uses_id ON emoji_uses (emoji_id);').run();
15
15
16
+
this.sql.prepare('CREATE TABLE IF NOT EXISTS study_times (id TEXT PRIMARY KEY, user_id TEXT NOT NULL, year INTEGER NOT NULL, month INTEGER NOT NULL, day INTEGER NOT NULL, time INTEGER NOT NULL);').run();
17
+
this.sql.prepare('CREATE UNIQUE INDEX IF NOT EXISTS idx_study_times_id ON study_times (id);').run();
18
+
16
19
this.sql.pragma('synchronous = 1');
17
20
this.sql.pragma('journal_mode = wal');
18
21
}
@@ -116,6 +119,54 @@ class Database {
116
119
this.sql.prepare('UPDATE emoji_uses SET count = count + ? WHERE emoji_id = ?;').run(count,emojiId);
0 commit comments