fix: store opened_at and closed_at as DATETIME (not DATE)
DATE columns lose time information, causing timeline to show 00:00 for car reception and WO closure. Migrated both columns to DATETIME and updated: model casts (date → datetime), form pickers (DatePicker → DateTimePicker with seconds:false), default to now() instead of today(), and cleaned up defensive Carbon::parse() in getTimeline(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('work_orders', function (Blueprint $table) {
|
||||
$table->dateTime('opened_at')->nullable()->change();
|
||||
$table->dateTime('closed_at')->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('work_orders', function (Blueprint $table) {
|
||||
$table->date('opened_at')->nullable()->change();
|
||||
$table->date('closed_at')->nullable()->change();
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user