Ghost/core/server/models
Fabien 'egg' O'Carroll 4fe417bcab
Added Product, StripeProduct & StripePrice relations (#12877)
refs https://github.com/TryGhost/Team/issues/586

We have to use `belongsToMany` because of the way bookshelf relations
work. In reality the relationship is 'hasMany', e.g. a Product has many
Stripe Prices.

These relations are the minimal needed to satisfy the following
relationships without transforming the results. (e.g. flattening the
StripePrices from a list of StripeProducts for a Product)

Product -> StripeProduct:       product.related('stripeProducts')
StripeProduct -> StripePrice:   stripeProduct.related('stripePrices');
Product -> StripePrice:         product.related('stripePrices');
StripePrice -> Product:         stripePrice.related('stripeProduct.product');
2021-04-14 19:20:39 +01:00
..
base 🐛 Fixed performance regression introduced in 4.1.0 (#12807) 2021-03-23 09:11:24 +00:00
plugins Added Product model and Member model relation (#12859) 2021-04-08 18:01:49 +01:00
relations Extracted promise libs and history into @tryghost/promise 2020-08-11 18:44:21 +01:00
action.js Added model implementation for actions 2019-02-06 21:36:09 +01:00
api-key.js Added the user_id field to the api_keys table 2020-11-20 09:53:18 +01:00
author.js Added plugin based author and public tag models in API v2 (#10284) 2019-01-03 20:30:35 +01:00
email-batch.js Fixed creation of EmailBatch and EmailRecipient collections 2020-10-14 15:11:45 +01:00
email-recipient.js Removed unnecessary bookshelf-relations config in EmailRecipient model 2021-01-05 15:28:30 +00:00
email.js Added migrations for email analytics (#12387) 2020-11-25 17:48:24 +00:00
index.js Added models for stripe prices and products 2021-04-12 21:53:59 +05:30
integration.js Updated host config to correctly use camelCase 2021-03-04 11:39:32 +00:00
invite.js 🐛 Allowed for inviting contributors when staff is limited 2021-03-15 11:40:44 +00:00
label.js Refactored common lib import to use destructuring (#11835) 2020-05-22 19:22:20 +01:00
member-email-change-event.js Added member relation to events (#12656) 2021-02-16 16:14:20 +00:00
member-login-event.js Added member relation to events (#12656) 2021-02-16 16:14:20 +00:00
member-paid-subscription-event.js Added member relation to events (#12656) 2021-02-16 16:14:20 +00:00
member-payment-event.js Added member relation to events (#12656) 2021-02-16 16:14:20 +00:00
member-status-event.js Fixed member status events query 2021-02-18 18:11:50 +05:30
member-stripe-customer.js Added error handling for failed member imports 2020-08-26 17:11:35 +12:00
member-subscribe-event.js Added member relation to events (#12656) 2021-02-16 16:14:20 +00:00
member.js Added Product model and Member model relation (#12859) 2021-04-08 18:01:49 +01:00
mobiledoc-revision.js Added mobiledoc revisions functionality 2018-10-09 15:31:09 +02:00
permission.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
post.js 🐛 Fixed plaintext and excerpt fallbacks having incorrect URLs after domain change (#12811) 2021-03-23 16:56:14 +00:00
posts-meta.js 🐛 Fixed performance regression introduced in 4.1.0 (#12807) 2021-03-23 09:11:24 +00:00
product.js Added Product, StripeProduct & StripePrice relations (#12877) 2021-04-14 19:20:39 +01:00
role.js Refactored common lib import to use destructuring (#11835) 2020-05-22 19:22:20 +01:00
session.js Removed user_id constraint when upserting session (#10085) 2018-10-30 16:15:48 +07:00
settings.js 🐛 Fixed performance regression introduced in 4.1.0 (#12807) 2021-03-23 09:11:24 +00:00
single-use-token.js 🐛 Added multiple use grace period to tokens (#12519) 2021-01-18 17:03:41 +00:00
snippet.js 🐛 Fixed performance regression introduced in 4.1.0 (#12807) 2021-03-23 09:11:24 +00:00
stripe-customer-subscription.js Removed hardcoded currency symbols (#12700) 2021-02-25 09:49:07 +00:00
stripe-price.js Added models for stripe prices and products 2021-04-12 21:53:59 +05:30
stripe-product.js Added Product, StripeProduct & StripePrice relations (#12877) 2021-04-14 19:20:39 +01:00
tag-public.js Added plugin based author and public tag models in API v2 (#10284) 2019-01-03 20:30:35 +01:00
tag.js 🐛 Fixed performance regression introduced in 4.1.0 (#12807) 2021-03-23 09:11:24 +00:00
user.js 🐛 Fixed limits not allowing contributors to be unsuspended 2021-03-23 14:04:18 +00:00
webhook.js Bumped webhook API defaults to v4 2021-03-02 12:31:52 +13:00