36 lines
1.4 KiB
PHP
36 lines
1.4 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()
|
|
{
|
|
Schema::create('customers', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->enum('type', ['private', 'business']);
|
|
$table->string('company_name', 100)->nullable();
|
|
$table->integer('customer_nr', false, true)->nullable();
|
|
$table->string('vat_id', 50)->nullable();
|
|
$table->string('tax_id', 50)->nullable();
|
|
$table->string('global_id', 50)->nullable();
|
|
$table->string('legal_registration_id', 50)->nullable();
|
|
$table->string('url', 100)->nullable();
|
|
$table->string('email', 100)->nullable();
|
|
$table->string('phone', 20)->nullable();
|
|
$table->json('billing_address')->nullable();
|
|
$table->foreignId('payment_terms_id')->constrained()->default(3); // Standard-Zahlungsziel: 14 Tage
|
|
$table->enum('status', ['active', 'inactive', 'prospect'])->default('active');
|
|
$table->string('description')->default('active');
|
|
$table->string('logo')->nullable();
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('customers');
|
|
}
|
|
};
|