35 lines
952 B
PHP
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');
|
|
}
|
|
};
|