From b4f53a0b755ff97a3e058ca38965b4d17270945a Mon Sep 17 00:00:00 2001 From: Rishabh Date: Tue, 8 Jun 2021 22:12:17 +0530 Subject: [PATCH] Reset active price ids for product on Stripe disconnect refs https://github.com/TryGhost/Ghost/commit/e17f5004cce2bccdb5e03b858e186a930346ecc5 In case of Stripe disconnect, it was possible that the product table still contained reference to monthly/yearly price id while the price itself isn't present in the DB. As part of Stripe disconnect reset, this also resets monthly/yearly price id for product. --- core/server/api/canary/settings.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/server/api/canary/settings.js b/core/server/api/canary/settings.js index 9277a0b4ab..8dc078ffd6 100644 --- a/core/server/api/canary/settings.js +++ b/core/server/api/canary/settings.js @@ -193,6 +193,9 @@ module.exports = { } /** Delete all Stripe data from DB */ + await ghostBookshelf.knex.raw(` + UPDATE products SET monthly_price_id = null, yearly_price_id = null + `); await ghostBookshelf.knex.raw(` DELETE FROM stripe_prices `);