-
-
Save DanyF-github/7821868aaccf90c942858d0b894e674f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CONFIGURE DATABASE | |
const dbFile = './.data/sqlite.db'; | |
var exists = fs.existsSync(dbFile); | |
const sqlite3 = require('sqlite3').verbose(); | |
const db = new sqlite3.Database(dbFile); | |
db.serialize(function(){ | |
if (!exists) { | |
db.run('CREATE TABLE State (phone NUMERIC UNIQUE, state NUMERIC, memo TEXT)') | |
db.run('CREATE TABLE Users (phone NUMERIC UNIQUE, username TEXT, email TEXT, address TEXT)'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment