Mailspring/packages/nylas-core/models/shared/account-token.js

22 lines
451 B
JavaScript
Raw Normal View History

2016-06-19 18:02:32 +08:00
module.exports = (sequelize, Sequelize) => {
const AccountToken = sequelize.define('AccountToken', {
value: {
type: Sequelize.UUID,
defaultValue: Sequelize.UUIDV4,
},
2016-06-19 18:02:32 +08:00
}, {
classMethods: {
associate: ({Account}) => {
AccountToken.belongsTo(Account, {
onDelete: "CASCADE",
foreignKey: {
allowNull: false,
},
});
},
},
});
return AccountToken;
};