Files
RomhackPlaza/database/migrations/2026_06_10_090320_create_news_table.php

43 lines
1.3 KiB
PHP
Raw Permalink Normal View History

2026-06-10 11:04:26 +02:00
<?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('news', function (Blueprint $table) {
2026-06-16 16:21:43 +02:00
2026-06-10 11:04:26 +02:00
$table->id();
2026-06-16 16:21:43 +02:00
$table->string('title');
$table->string('slug')->unique();
$table->foreignId('category_id')->nullable()->constrained('categories')->nullOnDelete();
$table->longText('description');
$table->enum('state', [ 'draft', 'pending', 'published', 'locked', 'rejected', 'hidden' ] )->default('draft');
$table->foreignId('entry_id')->nullable()->constrained('entries')->nullOnDelete();
$table->string('relevant_link', 500 )->nullable();
$table->string('youtube_link', 500 )->nullable();
$table->unsignedBigInteger( 'user_id' ); // xf_user_id
$table->unsignedBigInteger( 'comments_thread_id' )->nullable(); // xf_thread
$table->softDeletes();
2026-06-10 11:04:26 +02:00
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('news');
}
};