mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Added model for offers
table
refs https://github.com/TryGhost/Team/issues/1088 - adds basic model definition for `offers` table
This commit is contained in:
parent
c2ea67b2ff
commit
78d0644d78
1 changed files with 13 additions and 0 deletions
13
core/server/models/offer.js
Normal file
13
core/server/models/offer.js
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
const ghostBookshelf = require('./base');
|
||||||
|
|
||||||
|
const Offer = ghostBookshelf.Model.extend({
|
||||||
|
tableName: 'offers',
|
||||||
|
|
||||||
|
product() {
|
||||||
|
return this.belongsTo('Product', 'product_id', 'id');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
Offer: ghostBookshelf.model('Offer', Offer)
|
||||||
|
};
|
Loading…
Add table
Reference in a new issue