gruene-seele/database/migrations/2026_03_27_123738_create_suppliers_table.php

32 lines
955 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('suppliers', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('url')->nullable();
$table->string('contact_person')->nullable();
$table->string('email')->nullable();
$table->string('phone', 100)->nullable();
$table->unsignedInteger('country_id');
$table->text('notes')->nullable();
$table->boolean('active')->default(true);
$table->timestamps();
$table->softDeletes();
$table->foreign('country_id')->references('id')->on('countries');
});
}
public function down(): void
{
Schema::dropIfExists('suppliers');
}
};