chore: Rename Authentication -> IntegrationAuthentication (#2091)

This commit is contained in:
Tom Moor
2021-04-27 18:42:45 -07:00
committed by GitHub
parent 829cc14d36
commit b89f4c36f4
7 changed files with 23 additions and 18 deletions

View File

@ -0,0 +1,26 @@
// @flow
import { DataTypes, sequelize, encryptedFields } from "../sequelize";
const IntegrationAuthentication = sequelize.define("authentication", {
id: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
primaryKey: true,
},
service: DataTypes.STRING,
scopes: DataTypes.ARRAY(DataTypes.STRING),
token: encryptedFields().vault("token"),
});
IntegrationAuthentication.associate = (models) => {
IntegrationAuthentication.belongsTo(models.User, {
as: "user",
foreignKey: "userId",
});
IntegrationAuthentication.belongsTo(models.Team, {
as: "team",
foreignKey: "teamId",
});
};
export default IntegrationAuthentication;