Ghost/core/server/models/index.js
Fabien O'Carroll 55f249a328 Added MemberProductEvent model & relations
refs https://github.com/TryGhost/Team/issues/873

We need a relation between members and their product events so that we
can pull out the events for a particular member to generate the start
date of their comped access to a product.
2021-08-24 14:44:53 +02:00

69 lines
1.2 KiB
JavaScript

/**
* Dependencies
*/
const _ = require('lodash');
// enable event listeners
require('./base/listeners');
/**
* Expose all models
*/
exports = module.exports;
const models = [
'permission',
'post',
'role',
'settings',
'session',
'tag',
'tag-public',
'user',
'author',
'invite',
'webhook',
'integration',
'api-key',
'mobiledoc-revision',
'member',
'product',
'benefit',
'stripe-product',
'stripe-price',
'member-subscribe-event',
'member-paid-subscription-event',
'member-login-event',
'member-email-change-event',
'member-payment-event',
'member-status-event',
'member-product-event',
'posts-meta',
'member-stripe-customer',
'stripe-customer-subscription',
'email',
'email-batch',
'email-recipient',
'label',
'single-use-token',
'snippet',
// Action model MUST be loaded last as it loops through all of the registered models
// Please do not append items to this array.
'action'
];
function init() {
exports.Base = require('./base');
models.forEach(function (name) {
_.extend(exports, require('./' + name));
});
}
/**
* Expose `init`
*/
exports.init = init;