Update knex to 0.15.2 and sqlite3 to 4.0.4

We also replace a createTableIfNotExists in the migrations with hasTable then createTable, to
avoid a warning message about it being not recommended.

Change-type: patch
Signed-off-by: Pablo Carranza Velez <pablo@balena.io>
This commit is contained in:
Pablo Carranza Velez 2018-11-23 14:50:29 -08:00
parent cbcf046d91
commit d5b2fcd4dd
3 changed files with 620 additions and 1378 deletions

1984
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -23,7 +23,7 @@
},
"private": "true",
"dependencies": {
"sqlite3": "^3.1.0"
"sqlite3": "^4.0.4"
},
"engines": {
"node": "^6.13.1"
@ -59,7 +59,7 @@
"husky": "^1.1.3",
"istanbul": "^0.4.5",
"json-mask": "^0.3.8",
"knex": "~0.12.3",
"knex": "~0.15.2",
"lint-staged": "^8.0.4",
"lockfile": "^1.0.1",
"lodash": "^4.16.3",

View File

@ -26,9 +26,13 @@ exports.up = function (knex, Promise) {
.tap(() => {
// take the logsChannelSecret, and the apiEndpoint config field,
// and store them in a new table
return knex.schema.createTableIfNotExists('logsChannelSecret', (t) => {
t.string('backend');
t.string('secret');
return knex.schema.hasTable('logsChannelSecret').then((exists) => {
if (!exists) {
return knex.schema.createTable('logsChannelSecret', (t) => {
t.string('backend');
t.string('secret');
});
}
});
})
.then((config) => {