DB: Add models and migration for badges

This commit is contained in:
2023-02-27 01:56:44 +01:00
parent 1a5e7c1b62
commit 06575d280f
4 changed files with 69 additions and 0 deletions

View File

@@ -11,6 +11,8 @@ module.exports = (sequelize, DataTypes) => {
*/
static associate(models) {
Character.belongsTo(models.Group, { foreignKey: 'groupId', });
// A character can belong to many badges
Character.belongsToMany(models.Badge, { through: 'BadgeCharacter' });
}
}
Character.init({