From 072dfa6ba2e10e4cd0137ad29f400e1cd019a7b6 Mon Sep 17 00:00:00 2001 From: Theo Weijmer Date: Wed, 8 Oct 2025 19:57:43 +0200 Subject: [PATCH] mysql specific migration --- ..._sent_status_to_service_requests_mysql.php | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 backend/database/migrations/2025_10_08_175630_add_mail_sent_status_to_service_requests_mysql.php diff --git a/backend/database/migrations/2025_10_08_175630_add_mail_sent_status_to_service_requests_mysql.php b/backend/database/migrations/2025_10_08_175630_add_mail_sent_status_to_service_requests_mysql.php new file mode 100644 index 0000000..0ebbd93 --- /dev/null +++ b/backend/database/migrations/2025_10_08_175630_add_mail_sent_status_to_service_requests_mysql.php @@ -0,0 +1,39 @@ +getDriverName(); + + if ($driver === 'mysql') { + // For MySQL, use ALTER TABLE MODIFY to update the ENUM + DB::statement("ALTER TABLE service_requests MODIFY COLUMN status ENUM('pending', 'confirmed', 'mail_sent', 'completed', 'cancelled') NOT NULL DEFAULT 'pending'"); + } + // For SQLite, the other migration handles it + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + // Check if we're using MySQL + $driver = DB::connection()->getDriverName(); + + if ($driver === 'mysql') { + // Revert to original ENUM values + DB::statement("ALTER TABLE service_requests MODIFY COLUMN status ENUM('pending', 'confirmed', 'completed', 'cancelled') NOT NULL DEFAULT 'pending'"); + } + // For SQLite, the other migration handles it + } +};