37 lines
1.3 KiB
Plaintext
37 lines
1.3 KiB
Plaintext
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration {
|
|
|
|
/**
|
|
* Run the migrations.
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('customers', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->enum('type', ['private', 'business']);
|
|
$table->string('company_name', 100)->nullable();
|
|
$table->string('vat_id', 50)->nullable();
|
|
$table->string('tax_id', 50)->nullable(); // Tax identification number
|
|
$table->string('global_id', 50)->nullable(); // Global Location Number (GLN)
|
|
$table->string('legal_registration_id', 50)->nullable(); // Legal registration ID
|
|
$table->string('email', 100)->unique();
|
|
$table->string('phone', 20)->nullable();
|
|
$table->json('billing_address'); // Structured as per ZUGFeRD standard
|
|
$table->integer('payment_terms')->default(14);
|
|
$table->enum('status', ['active', 'inactive', 'prospect'])->default('active');
|
|
$table->text('notes')->nullable();
|
|
$table->timestamps();
|
|
// $table->index('email');
|
|
});
|
|
}
|
|
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('customers');
|
|
}
|
|
}; |