Skip to content

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.

feat: DB and Model for docker cleanup executions

peaklabs-dev52abc7cc9256
diff --git a/app/Models/DockerCleanupExecution.php b/app/Models/DockerCleanupExecution.php
new file mode 100644
index 0000000000..405037e307
--- /dev/null
+++ b/app/Models/DockerCleanupExecution.php
@@ -0,0 +1,15 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
+
+class DockerCleanupExecution extends BaseModel
+{
+ protected $guarded = [];
+
+ public function server(): BelongsTo
+ {
+ return $this->belongsTo(Server::class);
+ }
+}
diff --git a/database/migrations/2025_01_15_130416_create_docker_cleanup_executions_table.php b/database/migrations/2025_01_15_130416_create_docker_cleanup_executions_table.php
new file mode 100644
index 0000000000..800038ba62
--- /dev/null
+++ b/database/migrations/2025_01_15_130416_create_docker_cleanup_executions_table.php
@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+ /**
+ * Run the migrations.
+ */
+ public function up(): void
+ {
+ Schema::create('docker_cleanup_executions', function (Blueprint $table) {
+ $table->id();
+ $table->string('uuid')->unique();
+ $table->enum('status', ['success', 'failed', 'running'])->default('running');
+ $table->text('message')->nullable();
+ $table->text('cleanup_details')->nullable();
+ $table->foreignId('server_id');
+ $table->timestamps();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void
+ {
+ Schema::dropIfExists('docker_cleanup_executions');
+ }
+};