Diversen
This commit is contained in:
+74
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
// For SQLite, we need to recreate the table to modify the enum
|
||||
// First, create a temporary table with the new structure
|
||||
Schema::create('service_requests_temp', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->text('address');
|
||||
$table->string('place');
|
||||
$table->string('email')->nullable();
|
||||
$table->string('phone')->nullable();
|
||||
$table->text('repair_description');
|
||||
$table->date('requested_date');
|
||||
$table->time('requested_time');
|
||||
$table->date('actual_repair_date')->nullable();
|
||||
$table->time('actual_repair_time')->nullable();
|
||||
$table->enum('status', ['pending', 'confirmed', 'mail_sent', 'completed', 'cancelled'])->default('pending');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
// Copy data from old table to temp table
|
||||
DB::statement('INSERT INTO service_requests_temp SELECT * FROM service_requests');
|
||||
|
||||
// Drop the old table
|
||||
Schema::dropIfExists('service_requests');
|
||||
|
||||
// Rename temp table to original name
|
||||
Schema::rename('service_requests_temp', 'service_requests');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
// Recreate the table with original enum values
|
||||
Schema::create('service_requests_temp', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->text('address');
|
||||
$table->string('place');
|
||||
$table->string('email')->nullable();
|
||||
$table->string('phone')->nullable();
|
||||
$table->text('repair_description');
|
||||
$table->date('requested_date');
|
||||
$table->time('requested_time');
|
||||
$table->date('actual_repair_date')->nullable();
|
||||
$table->time('actual_repair_time')->nullable();
|
||||
$table->enum('status', ['pending', 'confirmed', 'completed', 'cancelled'])->default('pending');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
// Copy data, converting 'mail_sent' status to 'confirmed'
|
||||
DB::statement("INSERT INTO service_requests_temp SELECT id, name, address, place, email, phone, repair_description, requested_date, requested_time, actual_repair_date, actual_repair_time, CASE WHEN status = 'mail_sent' THEN 'confirmed' ELSE status END, created_at, updated_at FROM service_requests");
|
||||
|
||||
// Drop the current table
|
||||
Schema::dropIfExists('service_requests');
|
||||
|
||||
// Rename temp table to original name
|
||||
Schema::rename('service_requests_temp', 'service_requests');
|
||||
}
|
||||
};
|
||||
@@ -38,6 +38,18 @@ class SettingsSeeder extends Seeder
|
||||
'key' => 'working_hours',
|
||||
'value' => 'Maandag-Vrijdag: 08:00 - 18:00, Zaterdag: 09:00 - 16:00',
|
||||
'description' => 'Bedrijfsopeningstijden'
|
||||
],
|
||||
[
|
||||
'key' => 'pickup_confirmation_email_text',
|
||||
'value' => 'Beste klant,
|
||||
|
||||
Uw fiets is klaar en kan worden opgehaald op het onderstaande tijdstip.
|
||||
|
||||
Wij zien u graag tegemoet!
|
||||
|
||||
Met vriendelijke groet,
|
||||
Fiets Service Centrum',
|
||||
'description' => 'Standaard tekst voor ophaalbevestiging e-mail'
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user