MiknasTrading/database/migrations/2026_05_17_132428_create_customers_table.php

31 lines
932 B
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('customers', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('contact_person')->nullable();
$table->string('email')->nullable();
$table->string('phone')->nullable();
$table->text('address')->nullable();
$table->string('tax_number')->nullable();
$table->decimal('credit_limit', 14, 2)->default(0);
$table->decimal('outstanding_balance', 14, 2)->default(0);
$table->boolean('is_active')->default(true);
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('customers');
}
};