inital commit

This commit is contained in:
Torsten Schulz
2024-06-15 23:01:46 +02:00
parent 1b7fefe381
commit 61653ff407
105 changed files with 7805 additions and 524 deletions

24
models/Position.js Normal file
View File

@@ -0,0 +1,24 @@
const { DataTypes } = require('sequelize');
module.exports = (sequelize) => {
const Position = sequelize.define('Position', {
caption: {
type: DataTypes.STRING,
allowNull: false
}
}, {
tableName: 'positions',
timestamps: false
});
Position.associate = function(models) {
Position.belongsToMany(models.ContactPerson, {
through: models.ContactPersonPosition,
foreignKey: 'position_id',
otherKey: 'contact_person_id',
as: 'contactPersons'
});
};
return Position;
};