2019-09-12 14:59:51 +02:00
|
|
|
module.exports = (sequelize, DataTypes) => {
|
|
|
|
|
const fed_users = sequelize.define('fed_users', {
|
|
|
|
|
ap_id: {
|
|
|
|
|
type: DataTypes.STRING,
|
|
|
|
|
primaryKey: true
|
|
|
|
|
},
|
|
|
|
|
object: DataTypes.JSON
|
|
|
|
|
}, {})
|
2019-10-28 17:33:20 +01:00
|
|
|
fed_users.associate = function (models) {
|
|
|
|
|
fed_users.belongsTo(models.instances)
|
2019-11-09 15:16:07 +01:00
|
|
|
fed_users.belongsToMany(models.user, { through: 'user_followers', as: 'followers' })
|
|
|
|
|
|
2019-10-28 17:33:20 +01:00
|
|
|
}
|
2019-09-12 14:59:51 +02:00
|
|
|
return fed_users
|
2019-10-28 17:33:20 +01:00
|
|
|
}
|