mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-10-22 02:56:18 +08:00
22 lines
571 B
JavaScript
22 lines
571 B
JavaScript
const {JSONARRAYType} = require('../../database-types');
|
|
|
|
module.exports = (sequelize, Sequelize) => {
|
|
return sequelize.define('transaction', {
|
|
event: Sequelize.STRING,
|
|
object: Sequelize.STRING,
|
|
objectId: Sequelize.STRING,
|
|
changedFields: JSONARRAYType('changedFields'),
|
|
}, {
|
|
instanceMethods: {
|
|
toJSON: function toJSON() {
|
|
return {
|
|
id: `${this.id}`,
|
|
event: this.event,
|
|
object: this.object,
|
|
objectId: this.objectId,
|
|
changedFields: this.changedFields,
|
|
}
|
|
},
|
|
},
|
|
});
|
|
}
|