mirror of
https://github.com/sp-tarkov/forge.git
synced 2025-02-13 04:30:41 -05:00
32 lines
879 B
PHP
32 lines
879 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('user_follows', function (Blueprint $table) {
|
||
|
$table->id();
|
||
|
$table->unsignedBigInteger('follower_id');
|
||
|
$table->unsignedBigInteger('following_id');
|
||
|
$table->foreign('follower_id')->references('id')->on('users')->cascadeOnDelete()->cascadeOnUpdate();
|
||
|
$table->foreign('following_id')->references('id')->on('users')->cascadeOnDelete()->cascadeOnUpdate();
|
||
|
$table->timestamps();
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
*/
|
||
|
public function down(): void
|
||
|
{
|
||
|
Schema::dropIfExists('user_follows');
|
||
|
}
|
||
|
};
|