|
Server : LiteSpeed System : Linux barito.iixcp.rumahweb.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 User : elvh3918 ( 1528) PHP Version : 8.2.31 Disable Function : mail Directory : /home/elvh3918/public_html/pmm/database/migrations/ |
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\Artisan;
use Database\Seeders\Trans\MaintenanceSeeder;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('maintenance', function (Blueprint $table) {
$table->id();
$table->string('series', 100);
$table->datetime('date_trans');
$table->bigInteger('tenant_id');
$table->bigInteger('technician_id');
$table->bigInteger('customer_id');
$table->bigInteger('item_id');
$table->string('service_type', 100);
$table->text('description')->nullable();
$table->text('note')->nullable();
$table->bigInteger('user_id');
$table->timestamps();
});
Schema::create('maintenance_detail', function (Blueprint $table) {
$table->id();
$table->bigInteger('maintenance_id');
$table->bigInteger('part_id');
$table->decimal('rate', 18, 4)->default(0);
$table->decimal('qty', 18, 4)->default(0);
$table->text('note')->nullable();
$table->timestamps();
});
Artisan::call('db:seed', [
'--class' => MaintenanceSeeder::class,
]);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('maintanance');
Schema::dropIfExists('maintenance_detail');
}
};