Script erstellt
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?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');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user