summaryrefslogtreecommitdiff
path: root/database/db.js
diff options
context:
space:
mode:
authorJulien Dessaux2022-10-30 23:16:47 +0100
committerJulien Dessaux2022-10-30 23:16:47 +0100
commitdc5a002144ff7165e73fb38f4be186d827df98c6 (patch)
treec121abb7e34ae56adb33ca612d5ced962b411b63 /database/db.js
parentAdded a basic database schema and migration function (diff)
downloadjeux-de-mots-dc5a002144ff7165e73fb38f4be186d827df98c6.tar.gz
jeux-de-mots-dc5a002144ff7165e73fb38f4be186d827df98c6.tar.bz2
jeux-de-mots-dc5a002144ff7165e73fb38f4be186d827df98c6.zip
Added register and login database functions, and use the last one in the login route
Diffstat (limited to 'database/db.js')
-rw-r--r--database/db.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/database/db.js b/database/db.js
index d849429..259ab58 100644
--- a/database/db.js
+++ b/database/db.js
@@ -11,7 +11,7 @@ db.pragma("foreign_keys = ON");
db.transaction(function migrate() {
let version;
try {
- version = db.prepare("SELECT version FROM schema_version").all()[0].version;
+ version = db.prepare("SELECT version FROM schema_version").get().version;
} catch {
version = 0;
}