2021-02-12 16:15:27 +03:00
|
|
|
const errors = require('@tryghost/errors');
|
|
|
|
const ghostBookshelf = require('./base');
|
|
|
|
|
|
|
|
const MemberEmailChangeEvent = ghostBookshelf.Model.extend({
|
2021-02-16 19:14:20 +03:00
|
|
|
tableName: 'members_email_change_events',
|
|
|
|
|
|
|
|
member() {
|
|
|
|
return this.belongsTo('Member', 'member_id', 'id');
|
|
|
|
}
|
2021-02-12 16:15:27 +03:00
|
|
|
}, {
|
|
|
|
async edit() {
|
2021-12-01 14:22:14 +03:00
|
|
|
throw new errors.IncorrectUsageError({message: 'Cannot edit MemberEmailChangeEvent'});
|
2021-02-12 16:15:27 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
async destroy() {
|
2021-12-01 14:22:14 +03:00
|
|
|
throw new errors.IncorrectUsageError({message: 'Cannot destroy MemberEmailChangeEvent'});
|
2021-02-12 16:15:27 +03:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
const MemberEmailChangeEvents = ghostBookshelf.Collection.extend({
|
|
|
|
model: MemberEmailChangeEvent
|
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
MemberEmailChangeEvent: ghostBookshelf.model('MemberEmailChangeEvent', MemberEmailChangeEvent),
|
|
|
|
MemberEmailChangeEvents: ghostBookshelf.collection('MemberEmailChangeEvents', MemberEmailChangeEvents)
|
|
|
|
};
|