chat-platform
Advanced tools
Comparing version 2.1.3 to 2.1.4
{ | ||
"name": "chat-platform", | ||
"version": "2.1.3", | ||
"version": "2.1.4", | ||
"description": "Universal Chat Platform", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -34,3 +34,3 @@ const _ = require('underscore'); | ||
if (_.isEmpty(params.chatbotId)) { | ||
throw 'SQLite context provider: missing parameter "chatbotId"'; | ||
throw 'SQLite context provider: missing parameter "chatbotId", if using the SQLite context store standalone, just add a key "chatbotId": "my-bot" in the params of the context store.'; | ||
} | ||
@@ -277,10 +277,10 @@ if (!fs.existsSync(params.dbPath)) { | ||
*/ | ||
// if table doesn't exists, then create | ||
const tableExists = await sequelize.query( | ||
"SELECT name FROM sqlite_master WHERE type='table' AND name='contexts';", | ||
{ type: QueryTypes.SELECT } | ||
); | ||
const createTable = tableExists.length === 0; | ||
// create the table | ||
try { | ||
// if table doesn't exists, then create | ||
const tableExists = await sequelize.query( | ||
"SELECT name FROM sqlite_master WHERE type='table' AND name='contexts';", | ||
{ type: QueryTypes.SELECT } | ||
); | ||
const createTable = tableExists.length === 0; | ||
if (createTable) { | ||
@@ -301,3 +301,2 @@ await Context.sync(); | ||
lcd.dump(e, 'Something went wrong creating the SQLite "contexts" table'); | ||
throw e; | ||
} | ||
@@ -316,2 +315,3 @@ | ||
+ '"dbPath": "/my-path/my-database.sqlite"\n' | ||
+ '"chatbotId": "my-bot"\n' | ||
+ '}</pre>' | ||
@@ -318,0 +318,0 @@ + '<br/> The table <em>context</em> will be automatically created.', |
1030671