Add application metrics model and relationships (#15417)

* Add application metrics model and relationships

* update schema check file

* Add missed index

* Update testing definition

* sqlite can't create the id later

* update schema dumps

* update testing_persistent schema

* update baseline
This commit is contained in:
Tony Murray
2023-10-12 02:24:27 -05:00
committed by GitHub
parent 7c5b0e3612
commit 0540c56d0f
14 changed files with 1939 additions and 2234 deletions

View File

@@ -49,4 +49,11 @@ class Application extends DeviceRelatedModel
{
return $this->displayName();
}
// ---- Define Relationships ----
public function metrics()
{
return $this->hasMany(ApplicationMetric::class, 'app_id', 'app_id');
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class ApplicationMetric extends Model
{
use HasFactory;
public $timestamps = false;
// ---- Define Relationships ----
public function app()
{
return $this->belongsTo(Application::class, 'app_id');
}
}