From ca74a0c2e2a1b5eedd4eb3fc25d14a16a8298529 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Bra=C3=B1a?= Date: Mon, 11 May 2026 14:00:21 +0200 Subject: [PATCH] Add phase_id to inspection_templates to allow templates per phase (optional) --- ...2_add_phase_id_to_inspection_templates.php | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 database/migrations/2026_05_11_115552_add_phase_id_to_inspection_templates.php diff --git a/database/migrations/2026_05_11_115552_add_phase_id_to_inspection_templates.php b/database/migrations/2026_05_11_115552_add_phase_id_to_inspection_templates.php new file mode 100644 index 0000000..c567cd7 --- /dev/null +++ b/database/migrations/2026_05_11_115552_add_phase_id_to_inspection_templates.php @@ -0,0 +1,30 @@ +foreignId('phase_id')->nullable()->constrained('phases')->onDelete('set null'); + $table->index('phase_id'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('inspection_templates', function (Blueprint $table) { + $table->dropForeign(['phase_id']); + $table->dropColumn('phase_id'); + }); + } +};