initialization and schema fixes, closes #111

This commit is contained in:
azivner
2018-06-01 22:26:37 -04:00
parent c07785be67
commit fc6669d254
4 changed files with 41 additions and 30 deletions

View File

@@ -94,6 +94,12 @@ async function isDbUpToDate() {
}
async function isUserInitialized() {
const optionsTable = await sql.getRows("SELECT name FROM sqlite_master WHERE type='table' AND name='options'");
if (optionsTable.length !== 1) {
return false;
}
const username = await sql.getValue("SELECT value FROM options WHERE name = 'username'");
return !!username;