knex-migrator 5.3.1 → 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 CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013-2025 Ghost Foundation
1
+ Copyright (c) 2013-2026 Ghost Foundation
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -336,7 +336,7 @@ knexMigrator.isDatabaseOK()
336
336
 
337
337
  # Copyright & License
338
338
 
339
- Copyright (c) 2013-2025 Ghost Foundation - Released under the [MIT license](LICENSE).
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('SELECT name FROM sqlite_master WHERE type="table";')
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 (err.errno === 1 || err.errno === 1146) {
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.1",
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.22",
51
- "@tryghost/errors": "1.3.6",
52
- "@tryghost/logging": "2.4.19",
53
- "@tryghost/promise": "0.3.8",
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.1",
57
- "knex": "2.5.1",
58
- "lodash": "4.17.21",
59
- "moment": "2.24.0",
60
- "mysql2": "3.14.1",
61
- "nconf": "0.12.1",
62
- "resolve": "1.22.8"
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": "15.1.0",
74
+ "nyc": "17.1.0",
75
75
  "rimraf": "3.0.2",
76
76
  "should": "13.2.3",
77
- "sinon": "9.2.4"
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
  }
@@ -0,0 +1,9 @@
1
+ {
2
+ "database": {
3
+ "client": "better-sqlite3",
4
+ "connection": {
5
+ "filename": "test.db"
6
+ },
7
+ "useNullAsDefault": true
8
+ }
9
+ }