From 3eb11533bd42558e2357299d6877afd8042e120f Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Mon, 23 Sep 2019 17:22:30 +0100 Subject: [PATCH] Marked the client auth table drop migration as irreversible no issue - bumps `knex-migrator` so it supports irreversible migrations - marks the `03-drop-client-auth` migration as irreversible because it destroys data that is not recoverable and is required for earlier versions of Ghost to function --- .../migrations/versions/3.0/03-drop-client-auth-tables.js | 6 +++++- package.json | 2 +- yarn.lock | 8 ++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/core/server/data/migrations/versions/3.0/03-drop-client-auth-tables.js b/core/server/data/migrations/versions/3.0/03-drop-client-auth-tables.js index 3c6e16d4f8..081e96c9aa 100644 --- a/core/server/data/migrations/versions/3.0/03-drop-client-auth-tables.js +++ b/core/server/data/migrations/versions/3.0/03-drop-client-auth-tables.js @@ -6,6 +6,10 @@ const tables = [ 'clients' ]; +module.exports.config = { + irreversible: true +}; + module.exports.up = (options) => { const connection = options.connection; @@ -26,5 +30,5 @@ module.exports.up = (options) => { // the schemas for the deleted tables no longer exist so there's nothing for // `commands.createTable` to draw from for the table structure module.exports.down = () => { - return Promise.resolve(); + return Promise.reject(); }; diff --git a/package.json b/package.json index 88d650d7de..e99a834f41 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "jsonwebtoken": "8.5.1", "keypair": "1.0.1", "knex": "0.19.4", - "knex-migrator": "3.3.3", + "knex-migrator": "3.4.0", "lodash": "4.17.15", "markdown-it": "9.1.0", "markdown-it-footnote": "3.0.2", diff --git a/yarn.lock b/yarn.lock index 3339639f69..28b1a4d26f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4675,10 +4675,10 @@ kind-of@^6.0.0, kind-of@^6.0.2: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== -knex-migrator@3.3.3: - version "3.3.3" - resolved "https://registry.yarnpkg.com/knex-migrator/-/knex-migrator-3.3.3.tgz#a080f98ff3b6947d9a6ea7af427f744971f388d3" - integrity sha512-GPKxmI9jeQlFLMHGZktM7fjckm0W+RUHN4SIq4lms40jNw9XiPK9LH0biUczIeM0hevqEFWEdfbbKU5zLVgaBw== +knex-migrator@3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/knex-migrator/-/knex-migrator-3.4.0.tgz#c110236fb1efe1c3b46d4bd7521abeae80df7497" + integrity sha512-Ay9Fpo/lxRQlibCT5dNaiyG49Jw4oSMdbm6fqf7BwriRkBwuQKyteSNVqAIhGMg0WdRjCeeBLoGlnwVXU/5QsA== dependencies: bluebird "^3.5.3" commander "^2.19.0"