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 + } +};