techblog/database/migrations/2025_11_09_121926_create_reactions_table.php

31 lines
665 B
PHP
Raw Normal View History

<?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('reactions', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->nullable();
$table->morphs('reactable');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('reactions');
}
};