knex-migrator 5.3.2 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/lib/database.js +1 -1
- package/lib/index.js +5 -1
- package/package.json +15 -14
- package/test/config/env/config.testing-better-sqlite3.json +9 -0
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -336,7 +336,7 @@ knexMigrator.isDatabaseOK()
|
|
|
336
336
|
|
|
337
337
|
# Copyright & License
|
|
338
338
|
|
|
339
|
-
Copyright (c) 2013-
|
|
339
|
+
Copyright (c) 2013-2026 Ghost Foundation - Released under the [MIT license](LICENSE).
|
|
340
340
|
|
|
341
341
|
|
|
342
342
|
|
package/lib/database.js
CHANGED
|
@@ -180,7 +180,7 @@ exports.drop = function drop(options) {
|
|
|
180
180
|
} else if (DatabaseInfo.isSQLite(connection)) {
|
|
181
181
|
// @NOTE: sqlite3 does not support "DROP DATABASE". We have to drop each table instead.
|
|
182
182
|
// @NOTE: We cannot just remove the sqlite3 file, because any database connection will get invalid.
|
|
183
|
-
return connection.raw(
|
|
183
|
+
return connection.raw(`SELECT name FROM sqlite_master WHERE type='table';`)
|
|
184
184
|
.then(function (tables) {
|
|
185
185
|
return sequence(tables.map(table => () => {
|
|
186
186
|
if (table.name === 'sqlite_sequence') {
|
package/lib/index.js
CHANGED
|
@@ -1207,7 +1207,11 @@ KnexMigrator.prototype._integrityCheck = async function _integrityCheck(options)
|
|
|
1207
1207
|
}
|
|
1208
1208
|
|
|
1209
1209
|
// CASE: migration table does not exist
|
|
1210
|
-
if (
|
|
1210
|
+
if (
|
|
1211
|
+
err.errno === 1
|
|
1212
|
+
|| err.errno === 1146
|
|
1213
|
+
|| (err.code === 'SQLITE_ERROR' && /no such table: migrations/.test(err.message))
|
|
1214
|
+
) {
|
|
1211
1215
|
throw new errors.DatabaseIsNotOkError({
|
|
1212
1216
|
message: 'Please run `yarn knex-migrator init`',
|
|
1213
1217
|
code: 'MIGRATION_TABLE_IS_MISSING'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "knex-migrator",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.0",
|
|
4
4
|
"description": "Database migrations with knex.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ghost",
|
|
@@ -47,19 +47,19 @@
|
|
|
47
47
|
"node": "^14.18.0 || ^16.13.0 || ^18.12.1 || ^20.11.1 || ^22.13.1"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@tryghost/database-info": "0.3.
|
|
51
|
-
"@tryghost/errors": "1.3.
|
|
52
|
-
"@tryghost/logging": "2.
|
|
53
|
-
"@tryghost/promise": "0.3.
|
|
50
|
+
"@tryghost/database-info": "0.3.35",
|
|
51
|
+
"@tryghost/errors": "1.3.13",
|
|
52
|
+
"@tryghost/logging": "2.5.5",
|
|
53
|
+
"@tryghost/promise": "0.3.20",
|
|
54
54
|
"commander": "5.1.0",
|
|
55
55
|
"compare-ver": "2.0.2",
|
|
56
|
-
"debug": "4.4.
|
|
57
|
-
"knex": "2.
|
|
58
|
-
"lodash": "4.
|
|
59
|
-
"moment": "2.
|
|
60
|
-
"mysql2": "3.
|
|
61
|
-
"nconf": "0.
|
|
62
|
-
"resolve": "1.22.
|
|
56
|
+
"debug": "4.4.3",
|
|
57
|
+
"knex": "3.2.10",
|
|
58
|
+
"lodash": "4.18.1",
|
|
59
|
+
"moment": "2.30.1",
|
|
60
|
+
"mysql2": "3.22.5",
|
|
61
|
+
"nconf": "0.13.0",
|
|
62
|
+
"resolve": "1.22.12"
|
|
63
63
|
},
|
|
64
64
|
"files": [
|
|
65
65
|
"bin",
|
|
@@ -71,12 +71,13 @@
|
|
|
71
71
|
"eslint": "6.8.0",
|
|
72
72
|
"eslint-plugin-ghost": "0.2.0",
|
|
73
73
|
"mocha": "7.2.0",
|
|
74
|
-
"nyc": "
|
|
74
|
+
"nyc": "17.1.0",
|
|
75
75
|
"rimraf": "3.0.2",
|
|
76
76
|
"should": "13.2.3",
|
|
77
|
-
"sinon": "
|
|
77
|
+
"sinon": "22.0.0"
|
|
78
78
|
},
|
|
79
79
|
"optionalDependencies": {
|
|
80
|
+
"better-sqlite3": "12.11.1",
|
|
80
81
|
"sqlite3": "5.1.7"
|
|
81
82
|
}
|
|
82
83
|
}
|