Mailspring/packages/nylas-core/models/account/thread.js
2016-06-22 17:34:29 -07:00

15 lines
346 B
JavaScript

module.exports = (sequelize, Sequelize) => {
const Thread = sequelize.define('Thread', {
threadId: Sequelize.STRING,
subject: Sequelize.STRING,
cleanedSubject: Sequelize.STRING,
}, {
classMethods: {
associate: ({Message}) => {
Thread.hasMany(Message, {as: 'messages'})
},
},
});
return Thread;
};