homeserver/src/models/device.js
/**
     * Helper method for defining associations.
     * This method is not a part of Sequelize lifecycle.
     * The `models/index` file will call this method automatically.
     */
Helper method for defining associations.
This method is not a part of Sequelize lifecycle.
The `models/index` file will call this method automatically.
Helper method for defining associations . This method is not a part of Sequelize lifecycle . The ` models / index ` file will call this method automatically .
static associate(models) {
      Device.belongsTo(models.Room, { allowNull: true });
      Device.belongsTo(models.Home, { allowNull: false });
      Device.hasMany(models.DeviceData);
      Device.hasMany(models.DeviceEvent);
    }
static associate ( models ) { Device . belongsTo ( models . Room , { allowNull : true } ) ; Device . belongsTo ( models . Home , { allowNull : false } ) ; Device . hasMany ( models . DeviceData ) ; Device . hasMany ( models . DeviceEvent ) ; }
Helper method for defining associations.
Helper method for defining associations .
// define association here