Ghost/core/server/models/stripe-price.js
Rish 5a659c9ebe Added models for stripe prices and products
refs https://github.com/TryGhost/Team/issues/586

Adds new models for stripe price and product tables
2021-04-12 21:53:59 +05:30

19 lines
496 B
JavaScript

const ghostBookshelf = require('./base');
const StripePrice = ghostBookshelf.Model.extend({
tableName: 'stripe_prices',
stripeProduct() {
return this.belongsTo('StripeProduct', 'stripe_product_id', 'stripe_product_id');
}
});
const StripePrices = ghostBookshelf.Collection.extend({
model: StripePrice
});
module.exports = {
StripePrice: ghostBookshelf.model('StripePrice', StripePrice),
StripePrices: ghostBookshelf.collection('StripePrices', StripePrices)
};