0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Reset active price ids for product on Stripe disconnect

refs e17f5004cc

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.
This commit is contained in:
Rishabh 2021-06-08 22:12:17 +05:30
parent faf9598d7a
commit b4f53a0b75

View file

@ -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
`);