Files
gamelog/database/migrations/2026_05_28_213108_create_follows_table.php
T

17 lines
672 B
PHP
Raw Normal View History

2026-05-29 00:33:00 +03:00
<?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('follows', function (Blueprint $table) {
$table->foreignId('follower_id')->constrained('users')->cascadeOnDelete();
$table->foreignId('following_id')->constrained('users')->cascadeOnDelete();
$table->primary(['follower_id', 'following_id']);
$table->index('following_id');
$table->timestamps();
});
}
public function down(): void { Schema::dropIfExists('follows'); }
};