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

22
models/EventType.js Normal file
View File

@@ -0,0 +1,22 @@
const { DataTypes } = require('sequelize');
module.exports = (sequelize) => {
const EventType = sequelize.define('EventType', {
caption: {
type: DataTypes.STRING,
allowNull: false
}
}, {
tableName: 'event_types',
timestamps: false
});
EventType.associate = function(models) {
EventType.hasMany(models.Event, {
foreignKey: 'eventTypeId',
as: 'events'
});
};
return EventType;
};