feat(migration): Add ssl_certificates table and model

This commit is contained in:
peaklabs-dev
2025-01-29 13:03:13 +01:00
parent a764a07e7e
commit 3f582a1ea4
2 changed files with 61 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up()
{
Schema::create('ssl_certificates', function (Blueprint $table) {
$table->id();
$table->text('ssl_certificate')->nullable();
$table->text('ssl_private_key')->nullable();
$table->string('resource_type')->nullable();
$table->unsignedBigInteger('resource_id')->nullable();
$table->enum('certificate_type', ['internal', 'external'])->default('internal');
$table->timestamp('valid_until')->nullable();
$table->timestamps();
$table->index(['resource_type', 'resource_id']);
});
}
public function down()
{
Schema::dropIfExists('ssl_certificates');
}
};