An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix(db): SSL certificates table and model
peaklabs-dev34216af497c2
diff --git a/app/Models/SslCertificate.php b/app/Models/SslCertificate.phpindex f414e5ecaf..d16860b22b 100644--- a/app/Models/SslCertificate.php+++ b/app/Models/SslCertificate.php@@ -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);+ }}diff --git a/database/migrations/2025_01_27_153741_create_ssl_certificates_table.php b/database/migrations/2025_01_27_153741_create_ssl_certificates_table.phpindex d7b02178d6..702f1f534e 100644--- a/database/migrations/2025_01_27_153741_create_ssl_certificates_table.php+++ b/database/migrations/2025_01_27_153741_create_ssl_certificates_table.php@@ -14,10 +14,12 @@ return new class extends Migration$table->text('ssl_private_key');$table->string('resource_type')->nullable();$table->unsignedBigInteger('resource_id')->nullable();- $table->timestamp('valid_until')->nullable();+ $table->unsignedBigInteger('server_id')->nullable();+ $table->timestamp('valid_until');$table->timestamps();- $table->index(['resource_type', 'resource_id']);+ $table->foreign('server_id')->references('id')->on('servers');+ $table->unique(['server_id', 'resource_id']);});}