mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-05-28 04:36:06 -04:00
Model: Use correct fk for service_customvar and add missing history relations
This commit is contained in:
parent
1764087063
commit
e698f52229
3 changed files with 5 additions and 0 deletions
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue