neonail-database/database/migrations/2025_01_15_000000_create_manufacturers_table.php
2025-08-10 18:09:07 +02:00

35 lines
952 B
PHP

<?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(): void
{
Schema::create('manufacturers', function (Blueprint $table) {
$table->id();
$table->string('name')->unique(); // Name des Herstellers (eindeutig)
$table->text('description')->nullable(); // Beschreibung des Herstellers
$table->string('website')->nullable(); // Website des Herstellers
$table->string('country')->nullable(); // Land des Herstellers
$table->timestamps();
// Index für schnelle Suche
$table->index('name');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('manufacturers');
}
};