fix(migration): ssl certificates table

- remove unique constraint
- add CA certificate boolean
- make sure that each certificate has a server_id so that we know which CA to use when renewing certificates
This commit is contained in:
peaklabs-dev 2025-02-02 14:56:26 +01:00
parent 4eba1d2130
commit 4305ba5f06
No known key found for this signature in database

View file

@ -14,12 +14,12 @@ public function up()
$table->text('ssl_private_key');
$table->string('resource_type')->nullable();
$table->unsignedBigInteger('resource_id')->nullable();
$table->unsignedBigInteger('server_id')->nullable();
$table->unsignedBigInteger('server_id');
$table->timestamp('valid_until');
$table->boolean('is_ca_certificate')->default(false);
$table->timestamps();
$table->foreign('server_id')->references('id')->on('servers');
$table->unique(['server_id', 'resource_id']);
});
}