diff --git a/app/Models/Host.php b/app/Models/Host.php new file mode 100644 index 0000000..6108d13 --- /dev/null +++ b/app/Models/Host.php @@ -0,0 +1,11 @@ +id(); + $table->string('hostname'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('hosts'); + } +}; diff --git a/database/migrations/2024_07_30_083526_create_maintenance_tasks_table.php b/database/migrations/2024_07_30_083526_create_maintenance_tasks_table.php new file mode 100644 index 0000000..bc20c62 --- /dev/null +++ b/database/migrations/2024_07_30_083526_create_maintenance_tasks_table.php @@ -0,0 +1,29 @@ +id(); + $table->string('hostname'); + $table->text('description'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('maintenance_tasks'); + } +}; diff --git a/database/migrations/2024_07_30_083536_create_maintenances_table.php b/database/migrations/2024_07_30_083536_create_maintenances_table.php new file mode 100644 index 0000000..ceffb99 --- /dev/null +++ b/database/migrations/2024_07_30_083536_create_maintenances_table.php @@ -0,0 +1,30 @@ +id(); + $table->string('name'); + $table->text('description'); + $table->string('schedule'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('maintenances'); + } +}; diff --git a/database/migrations/2024_07_30_083546_create_maintenance_task_histories_table.php b/database/migrations/2024_07_30_083546_create_maintenance_task_histories_table.php new file mode 100644 index 0000000..b351a99 --- /dev/null +++ b/database/migrations/2024_07_30_083546_create_maintenance_task_histories_table.php @@ -0,0 +1,35 @@ +id(); + $table->foreignIdFor(Task::class); + $table->foreignIdFor(MaintenanceHistory::class); + $table->foreignIdFor(Host::class); + $table->string('status'); + $table->datetime('finished_at'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('maintenance_task_histories'); + } +}; diff --git a/database/migrations/2024_07_30_083555_create_maintenance_histories_table.php b/database/migrations/2024_07_30_083555_create_maintenance_histories_table.php new file mode 100644 index 0000000..274aede --- /dev/null +++ b/database/migrations/2024_07_30_083555_create_maintenance_histories_table.php @@ -0,0 +1,33 @@ +id(); + $table->foreignIdFor(Maintenance::class); + $table->foreignIdFor(User::class); + $table->datetime('start_at'); + $table->datetime('finished_at'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('maintenance_histories'); + } +}; diff --git a/database/migrations/2024_07_30_083607_create_maintenance_host_histories_table.php b/database/migrations/2024_07_30_083607_create_maintenance_host_histories_table.php new file mode 100644 index 0000000..3f80778 --- /dev/null +++ b/database/migrations/2024_07_30_083607_create_maintenance_host_histories_table.php @@ -0,0 +1,31 @@ +id(); + $table->foreignIdFor(Maintenance::class); + $table->foreignIdFor(Host::class); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('maintenance_host_histories'); + } +};