Update models to have more relationships and timestamp column definitions.

This commit is contained in:
Taylor Dondich
2019-04-25 14:15:41 -07:00
committed by Paula Quispe
parent 9aec728509
commit 426c2f6f39
5 changed files with 34 additions and 2 deletions

View File

@@ -14,9 +14,9 @@ class Process extends Model
{
// Set our table name
protected $table = 'PROCESS';
// We do have a created at, but we don't store an updated at
// Our custom timestamp columns
const CREATED_AT = 'PRO_CREATE_DATE';
const UPDATED_AT = null;
const UPDATED_AT = 'PRO_UPDATE_DATE';
/**
* Retrieve all applications that belong to this process
@@ -26,4 +26,9 @@ class Process extends Model
return $this->hasMany(Application::class, 'PRO_ID', 'PRO_ID');
}
public function creator()
{
return $this->hasOne(User::class, 'PRO_CREATE_USER', 'USR_UID');
}
}