fix(db): SSL certificates table and model

- server_id is a foreign id
- server_id must be unique as each server can only have 1 CA cert
- resource_id must be unique as each resource can only have 1 SSL cert
This commit is contained in:
peaklabs-dev
2025-01-31 12:35:34 +01:00
parent 0915303769
commit 34216af497
2 changed files with 10 additions and 2 deletions

View File

@@ -11,6 +11,7 @@ class SslCertificate extends Model
'ssl_private_key',
'resource_type',
'resource_id',
'server_id',
'valid_until',
];
@@ -24,4 +25,9 @@ class SslCertificate extends Model
{
return $this->morphTo();
}
public function server()
{
return $this->belongsTo(Server::class);
}
}