Initialer Laravel Commit für BetiX
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (8.4) (push) Has been cancelled
tests / ci (8.5) (push) Has been cancelled

This commit is contained in:
2026-04-04 18:01:50 +02:00
commit 0280278978
374 changed files with 65210 additions and 0 deletions

View File

@@ -0,0 +1,78 @@
<?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
{
// ---------------------------------------------------------------
// FRIENDS
// ---------------------------------------------------------------
Schema::create('friends', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
$table->foreignId('friend_id')->constrained('users')->cascadeOnDelete();
$table->enum('status', ['pending', 'accepted', 'blocked'])->default('pending');
$table->timestamps();
$table->unique(['user_id', 'friend_id']);
$table->index(['friend_id', 'status']);
});
// ---------------------------------------------------------------
// PROFILE LIKES
// ---------------------------------------------------------------
Schema::create('profile_likes', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained()->cascadeOnDelete(); // The liker
$table->foreignId('profile_id')->constrained('users')->cascadeOnDelete(); // The profile owner
$table->timestamps();
$table->unique(['user_id', 'profile_id']);
$table->index('profile_id');
});
// ---------------------------------------------------------------
// PROFILE COMMENTS
// ---------------------------------------------------------------
Schema::create('profile_comments', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained()->cascadeOnDelete(); // The commenter
$table->foreignId('profile_id')->constrained('users')->cascadeOnDelete(); // The profile owner
$table->text('content');
$table->timestamps();
$table->index(['profile_id', 'created_at']);
});
// ---------------------------------------------------------------
// PROFILE REPORTS
// ---------------------------------------------------------------
Schema::create('profile_reports', function (Blueprint $table) {
$table->id();
$table->foreignId('reporter_id')->constrained('users')->cascadeOnDelete();
$table->foreignId('profile_id')->constrained('users')->cascadeOnDelete();
$table->string('reason');
$table->text('details')->nullable();
$table->json('snapshot')->nullable();
$table->string('screenshot_path', 500)->nullable();
$table->enum('status', ['pending', 'reviewed', 'dismissed'])->default('pending');
$table->text('admin_note')->nullable();
$table->timestamps();
$table->index(['profile_id', 'status']);
$table->index('reporter_id');
});
}
public function down(): void
{
Schema::dropIfExists('profile_reports');
Schema::dropIfExists('profile_comments');
Schema::dropIfExists('profile_likes');
Schema::dropIfExists('friends');
}
};