0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Passed Settings model to @tryghost/members-api

refs https://github.com/TryGhost/Team/issues/637
refs https://github.com/TryGhost/Team/issues/591

We need to run migrations which will update the `portal_plans` setting
to use id's rather than names. This migration relies on the
`stripe_prices` table being complete populated. The migration to
populate the `stripe_prices` table was not added as a "normal"
migration because it needs to access the Stripe API over the network.
Any migrations that rely on this are unable to be run in a "normal"
migration as that cannot be sure that the database is in the correct
state.

The `portal_plans` setting migration is therefore run in code, and needs
access to the Settings model in order to modify the database.
This commit is contained in:
Fabien O'Carroll 2021-05-03 13:59:13 +01:00
parent a83cccd84b
commit fa327a7a85

View file

@ -177,7 +177,8 @@ function createApiInstance(config) {
MemberStatusEvent: models.MemberStatusEvent,
StripeProduct: models.StripeProduct,
StripePrice: models.StripePrice,
Product: models.Product
Product: models.Product,
Settings: models.Settings
},
logger: logging
});