mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Added ghost_subscription_id to members_stripe_customers_subscriptions table in data generator
no issue
This commit is contained in:
parent
0f925dde8c
commit
98f0b6c7ce
4 changed files with 5 additions and 4 deletions
|
@ -344,7 +344,7 @@ class DataGenerator {
|
|||
});
|
||||
const membersStripeCustomersSubscriptions = await membersStripeCustomersSubscriptionsImporter.importForEach(subscriptions, {
|
||||
amount: 1,
|
||||
rows: ['mrr', 'plan_id', 'subscription_id']
|
||||
rows: ['mrr', 'plan_id', 'ghost_subscription_id']
|
||||
});
|
||||
|
||||
const membersSubscribeEventsImporter = new MembersSubscribeEventsImporter(transaction, {newsletters, subscriptions});
|
||||
|
|
|
@ -20,7 +20,7 @@ class MembersPaidSubscriptionEventsImporter extends TableImporter {
|
|||
}
|
||||
// TODO: Implement upgrades
|
||||
const membersStripeCustomersSubscription = this.membersStripeCustomersSubscriptions.find((m) => {
|
||||
return m.subscription_id === this.model.id;
|
||||
return m.ghost_subscription_id === this.model.id;
|
||||
});
|
||||
return {
|
||||
id: faker.database.mongodbObjectId(),
|
||||
|
|
|
@ -29,7 +29,8 @@ class MembersStripeCustomersSubscriptionsImporter extends TableImporter {
|
|||
return {
|
||||
id: faker.database.mongodbObjectId(),
|
||||
customer_id: customer.customer_id,
|
||||
subscription_id: this.model.id,
|
||||
ghost_subscription_id: this.model.id,
|
||||
subscription_id: `sub_${faker.random.alphaNumeric(14)}`,
|
||||
stripe_price_id: stripePrice.stripe_price_id,
|
||||
status: 'active',
|
||||
cancel_at_period_end: false,
|
||||
|
|
|
@ -14,7 +14,7 @@ class MembersSubscriptionCreatedEventsImporter extends TableImporter {
|
|||
}
|
||||
|
||||
generate() {
|
||||
const subscription = this.subscriptions.find(s => s.id === this.model.subscription_id);
|
||||
const subscription = this.subscriptions.find(s => s.id === this.model.ghost_subscription_id);
|
||||
return {
|
||||
id: faker.database.mongodbObjectId(),
|
||||
created_at: subscription.created_at,
|
||||
|
|
Loading…
Add table
Reference in a new issue