23-01-2026

This commit is contained in:
Kevin Adametz 2026-01-23 17:33:10 +01:00
parent 07959c0ba2
commit 854ce02bf6
166 changed files with 32909 additions and 1262 deletions

View file

@ -19,6 +19,7 @@ return new class extends Migration
$table->string('slug')->unique();
$table->string('logo_url')->nullable();
$table->text('description')->nullable();
$table->boolean('is_active')->default(true);
$table->timestamps();
});
}

View file

@ -0,0 +1,33 @@
<?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('registration_codes', function (Blueprint $table) {
$table->id();
$table->string('code')->unique();
$table->string('role'); // broker|customer|retailer|manufacturer
$table->string('status')->default('available'); // available|used|expired
$table->foreignId('broker_partner_id')->nullable()->constrained('partners')->nullOnDelete();
$table->foreignId('partner_id')->nullable()->constrained('partners')->nullOnDelete();
$table->foreignId('used_by_user_id')->nullable()->constrained('users')->nullOnDelete();
$table->timestamp('used_at')->nullable();
$table->timestamp('expires_at')->nullable();
$table->json('metadata')->nullable();
$table->timestamps();
$table->index(['role', 'status']);
$table->index('broker_partner_id');
$table->index('partner_id');
});
}
public function down(): void
{
Schema::dropIfExists('registration_codes');
}
};

View file

@ -0,0 +1,30 @@
<?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::table('registration_codes', function (Blueprint $table) {
$table->string('name')->nullable()->after('role');
$table->foreignId('assigned_to_code_id')->nullable()->after('broker_partner_id')->constrained('registration_codes')->nullOnDelete();
// Indizes für bessere Performance
$table->index('name');
$table->index('assigned_to_code_id');
});
}
public function down(): void
{
Schema::table('registration_codes', function (Blueprint $table) {
$table->dropIndex(['name']);
$table->dropIndex(['assigned_to_code_id']);
$table->dropForeign(['assigned_to_code_id']);
$table->dropColumn(['name', 'assigned_to_code_id']);
});
}
};

View file

@ -0,0 +1,28 @@
<?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::table('roles', function (Blueprint $table) {
$table->string('reg_prefix', 1)->nullable()->after('can_be_invited');
$table->string('reg_description')->nullable()->after('reg_prefix');
$table->integer('reg_start_number')->nullable()->after('reg_description');
// Index für Prefix-Suche
$table->index('reg_prefix');
});
}
public function down(): void
{
Schema::table('roles', function (Blueprint $table) {
$table->dropIndex(['reg_prefix']);
$table->dropColumn(['reg_prefix', 'reg_description', 'reg_start_number']);
});
}
};

View file

@ -0,0 +1,31 @@
<?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::table('users', function (Blueprint $table) {
// Name für die Zuordnung von Kunden (für Makler, Händler, Hersteller)
$table->string('display_name')->nullable()->after('name');
$table->index('display_name');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropIndex(['display_name']);
$table->dropColumn('display_name');
});
}
};

View file

@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* Hinweis: Diese Spalte wurde später in parent_partner_id umbenannt.
* Siehe Migration: 2025_12_17_123422_rename_broker_partner_id_to_parent_partner_id_in_partners_table
*/
public function up(): void
{
Schema::table('partners', function (Blueprint $table) {
// Für Kunden: Verknüpfung zum zugeordneten Makler/Händler
// Wird später zu parent_partner_id umbenannt
$table->foreignId('broker_partner_id')
->nullable()
->after('hub_id')
->constrained('partners')
->nullOnDelete();
$table->index('broker_partner_id');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('partners', function (Blueprint $table) {
$table->dropIndex(['broker_partner_id']);
$table->dropForeign(['broker_partner_id']);
$table->dropColumn('broker_partner_id');
});
}
};

View file

@ -0,0 +1,30 @@
<?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::table('partners', function (Blueprint $table) {
// Umbenennen der Spalte für generische Verwendung
// (sowohl für Makler/Estate-Agent als auch Händler/Retailer)
$table->renameColumn('broker_partner_id', 'parent_partner_id');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('partners', function (Blueprint $table) {
$table->renameColumn('parent_partner_id', 'broker_partner_id');
});
}
};

View file

@ -0,0 +1,33 @@
<?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::table('partners', function (Blueprint $table) {
// Brand/Theme speichern für Wiedererkennung im Portal
// Werte: b2in, b2a, stileigentum, style2own
$table->string('brand')->nullable()->after('type');
$table->index('brand');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('partners', function (Blueprint $table) {
$table->dropIndex(['brand']);
$table->dropColumn('brand');
});
}
};

View file

@ -0,0 +1,53 @@
<?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::table('partners', function (Blueprint $table) {
// Kontaktdaten und Adresse
$table->string('salutation')->nullable()->after('brand'); // Herr, Frau, Divers
$table->string('first_name')->nullable()->after('salutation');
$table->string('last_name')->nullable()->after('first_name');
$table->string('street')->nullable()->after('description');
$table->string('house_number')->nullable()->after('street');
$table->string('zip')->nullable()->after('house_number');
$table->string('city')->nullable()->after('zip');
$table->string('country')->default('Deutschland')->after('city');
$table->string('phone')->nullable()->after('country');
$table->string('website')->nullable()->after('phone');
// Display Name für Broker (kann vom Firmennamen abweichen)
$table->string('display_name')->nullable()->after('company_name');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('partners', function (Blueprint $table) {
$table->dropColumn([
'salutation',
'first_name',
'last_name',
'street',
'house_number',
'zip',
'city',
'country',
'phone',
'website',
'display_name',
]);
});
}
};

View file

@ -0,0 +1,28 @@
<?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::table('users', function (Blueprint $table) {
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropSoftDeletes();
});
}
};

View file

@ -0,0 +1,29 @@
<?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::table('brands', function (Blueprint $table) {
$table->foreignId('partner_id')->after('id')->nullable()->constrained('partners')->nullOnDelete();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('brands', function (Blueprint $table) {
$table->dropForeign(['partner_id']);
$table->dropColumn('partner_id');
});
}
};

View file

@ -0,0 +1,32 @@
<?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('display_videos', function (Blueprint $table) {
$table->id();
$table->string('filename'); // Dateiname des Videos (z.B. herbst_2025.mp4)
$table->string('title')->nullable(); // Optionaler Titel für bessere Verwaltung
$table->integer('position')->default(25); // Position in % (0-100)
$table->integer('sort_order')->default(0); // Reihenfolge der Wiedergabe
$table->boolean('is_active')->default(true); // Aktiv/Inaktiv
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('display_videos');
}
};

View file

@ -0,0 +1,32 @@
<?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('display_footer_contents', function (Blueprint $table) {
$table->id();
$table->string('headline'); // Überschrift (z.B. "Beratung & Termin")
$table->string('subline'); // Unterzeile (z.B. "Jetzt Termin vereinbaren.")
$table->string('url'); // URL für den QR-Code
$table->integer('sort_order')->default(0); // Reihenfolge der Anzeige
$table->boolean('is_active')->default(true); // Aktiv/Inaktiv
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('display_footer_contents');
}
};

View file

@ -0,0 +1,29 @@
<?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::table('display_footer_contents', function (Blueprint $table) {
$table->string('short_code', 10)->unique()->nullable()->after('url');
$table->unsignedInteger('clicks')->default(0)->after('short_code');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('display_footer_contents', function (Blueprint $table) {
$table->dropColumn(['short_code', 'clicks']);
});
}
};

View file

@ -0,0 +1,30 @@
<?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::table('display_footer_contents', function (Blueprint $table) {
$table->string('url')->nullable()->change();
$table->string('short_code', 10)->nullable()->change();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('display_footer_contents', function (Blueprint $table) {
$table->string('url')->nullable(false)->change();
$table->string('short_code', 10)->nullable(false)->change();
});
}
};