Files
CKB/database/migrations/2025_07_10_140406_create_postchecks_table.php

55 lines
2.0 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePostchecksTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('postchecks', function (Blueprint $table) {
$table->id();
$table->foreignId('transaction_id')->constrained()->onDelete('cascade');
$table->foreignId('postcheck_by')->constrained('users')->onDelete('cascade');
$table->timestamp('postcheck_at')->nullable();
$table->string('police_number');
$table->string('spk_number');
$table->string('front_image');
$table->decimal('kilometer', 10, 2);
$table->decimal('pressure_high', 10, 2);
$table->decimal('pressure_low', 10, 2)->nullable();
$table->decimal('cabin_temperature', 10, 2)->nullable();
$table->string('cabin_temperature_image')->nullable();
$table->enum('ac_condition', ['sudah dikerjakan', 'sudah diganti'])->nullable();
$table->string('ac_image')->nullable();
$table->enum('blower_condition', ['sudah dibersihkan atau dicuci', 'sudah diganti'])->nullable();
$table->string('blower_image')->nullable();
$table->enum('evaporator_condition', ['sudah dikerjakan', 'sudah diganti'])->nullable();
$table->string('evaporator_image')->nullable();
$table->enum('compressor_condition', ['sudah dikerjakan', 'sudah diganti'])->nullable();
$table->text('postcheck_notes')->nullable();
$table->timestamps();
$table->index(['transaction_id']);
$table->index(['postcheck_by']);
$table->index(['postcheck_at']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('postchecks');
}
}