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

21 lines
451 B
JavaScript

module.exports = (sequelize, Sequelize) => {
const AccountToken = sequelize.define('AccountToken', {
value: {
type: Sequelize.UUID,
defaultValue: Sequelize.UUIDV4,
},
}, {
classMethods: {
associate: ({Account}) => {
AccountToken.belongsTo(Account, {
onDelete: "CASCADE",
foreignKey: {
allowNull: false,
},
});
},
},
});
return AccountToken;
};