This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
outline/server/models/Event.js
Tom Moor 32ba98bb1a
Unfurling of Slack links (#487)
* First pass: Unfurling of Slack links

* Add authentication in db

* Call associate on Event correctly

* Add SLACK_APP_ID, remove SLACK_REDIRECT_URI, tidy env sample

* PR feedback

* Comment clarify
2017-12-18 19:59:29 -08:00

30 lines
575 B
JavaScript

// @flow
import { DataTypes, sequelize } from '../sequelize';
const Event = sequelize.define('event', {
id: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
primaryKey: true,
},
name: DataTypes.STRING,
data: DataTypes.JSONB,
});
Event.associate = models => {
Event.belongsTo(models.User, {
as: 'user',
foreignKey: 'userId',
});
Event.belongsTo(models.Collection, {
as: 'collection',
foreignKey: 'collectionId',
});
Event.belongsTo(models.Team, {
as: 'team',
foreignKey: 'teamId',
});
};
export default Event;