Files
sam-api/database/migrations/2025_07_28_183746_create_materials_table.php

32 lines
1.3 KiB
PHP

<?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::create('materials', function (Blueprint $table) {
$table->id()->comment('자재 PK');
$table->unsignedBigInteger('tenant_id')->comment('테넌트ID');
$table->string('name', 100)->comment('자재명(품명)');
$table->string('specification', 100)->nullable()->comment('규격');
$table->string('material_code', 50)->unique()->comment('자재코드');
$table->string('unit', 10)->comment('단위');
$table->char('is_inspection', 1)->default('N')->comment('검사대상 여부(Y/N)');
$table->text('search_tag')->nullable()->comment('검색 태그');
$table->text('remarks')->nullable()->comment('비고');
$table->unsignedBigInteger('created_by')->comment('생성자(회원PK)');
$table->unsignedBigInteger('updated_by')->nullable()->comment('수정자(회원PK)');
$table->timestamps();
$table->softDeletes();
});
}
public function down(): void
{
Schema::dropIfExists('materials');
}
};