From 52abc7cc925689995e21c680219c700b77204769 Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Wed, 15 Jan 2025 17:11:15 +0100 Subject: [PATCH] feat: DB and Model for docker cleanup executions --- app/Models/DockerCleanupExecution.php | 15 +++++++++ ...create_docker_cleanup_executions_table.php | 32 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 app/Models/DockerCleanupExecution.php create mode 100644 database/migrations/2025_01_15_130416_create_docker_cleanup_executions_table.php diff --git a/app/Models/DockerCleanupExecution.php b/app/Models/DockerCleanupExecution.php new file mode 100644 index 000000000..405037e30 --- /dev/null +++ b/app/Models/DockerCleanupExecution.php @@ -0,0 +1,15 @@ +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 000000000..800038ba6 --- /dev/null +++ b/database/migrations/2025_01_15_130416_create_docker_cleanup_executions_table.php @@ -0,0 +1,32 @@ +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'); + } +};