diff options
Diffstat (limited to '')
| -rw-r--r-- | db.js | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -0,0 +1,9 @@ +const sqlite3 = require('sqlite3').verbose(); +const db = new sqlite3.Database('./app.db'); +db.serialize(() => { + db.run(`CREATE TABLE IF NOT EXISTS users ( + id INTEGER PRIMARY KEY, username TEXT UNIQUE, password TEXT)`); + db.run(`CREATE TABLE IF NOT EXISTS items ( + id INTEGER PRIMARY KEY, user_id INTEGER, title TEXT, content TEXT)`); +}); +module.exports = db; |