"use strict";

module.exports = function(sequelize, DataTypes) {
  var PerHoursMeanEvent =  sequelize.define('PerHoursMeanEvent', {
	date: DataTypes.DATE,
	type: DataTypes.INTEGER,
	value: DataTypes.STRING,
	address: DataTypes.INTEGER,
	comment: DataTypes.TEXT
}, {
    classMethods: {
      associate: function(models) {
        PerHoursMeanEvent.belongsTo(models.SensorLocation, {foreignKey: 'address'});
      }
    }
  });

  return PerHoursMeanEvent;
};