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

View File

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