Mailspring/packages/nylas-core/models/account/transaction.js
2016-06-22 14:41:32 -07:00

18 lines
488 B
JavaScript

module.exports = (sequelize, Sequelize) => {
const Transaction = sequelize.define('Transaction', {
type: Sequelize.STRING,
objectId: Sequelize.STRING,
modelName: Sequelize.STRING,
changedFields: {
type: Sequelize.STRING,
get: function get() {
return JSON.parse(this.getDataValue('changedFields'))
},
set: function set(val) {
this.setDataValue('changedFields', JSON.stringify(val));
},
},
});
return Transaction;
};