Files
movies/database/migrations/2024_12_30_010251_create_comments_table.php
T
2024-12-30 03:06:20 +02:00

38 lines
970 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('comments', function (Blueprint $table) {
$table->id();
$table->integer('entity_id');
$table->string('entity_type');
$table->integer('user_id')->nullable(true);
$table->string('author_name');
$table->string('author_avatar');
$table->integer('author_rating');
$table->text('content');
$table->datetime('published_at');
$table->string('tmdb_id');
$table->string('tmdb_url');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('comments');
}
};