Model: Use correct fk for service_customvar and add missing history relations

This commit is contained in:
Johannes Meyer 2019-11-22 15:57:45 +01:00
parent 1764087063
commit e698f52229
3 changed files with 5 additions and 0 deletions

View file

@ -117,7 +117,9 @@ class Host extends Model
$relations->hasOne('state', HostState::class)->setJoinType('LEFT');
$relations->hasMany('comment', Comment::class);
$relations->hasMany('downtime', Downtime::class);
$relations->hasMany('history', History::class);
$relations->hasMany('notification', Notification::class);
$relations->hasMany('notification_history', NotificationHistory::class);
$relations->hasMany('service', Service::class)->setJoinType('LEFT');
}
}

View file

@ -110,6 +110,8 @@ class Service extends Model
$relations->hasOne('state', ServiceState::class)->setJoinType('LEFT');
$relations->hasMany('comment', Comment::class);
$relations->hasMany('downtime', Downtime::class);
$relations->hasMany('history', History::class);
$relations->hasMany('notification', Notification::class);
$relations->hasMany('notification_history', NotificationHistory::class);
}
}

View file

@ -32,6 +32,7 @@ class ServiceCustomvar extends Model
$relations->belongsTo('service', Service::class);
$relations->belongsTo('customvar', Customvar::class);
$relations->belongsTo('customvar_flat', CustomvarFlat::class)
->setForeignKey('customvar_id')
->setCandidateKey('customvar_id');
}
}