fedi-feed-router/database/migrations/2025_07_05_003216_create_feeds_table.php
2025-07-05 02:37:38 +02:00

31 lines
No EOL
1 KiB
PHP

<?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('feeds', function (Blueprint $table) {
$table->id();
$table->string('name'); // "VRT News", "Belga News Agency"
$table->string('url'); // "https://vrt.be" or "https://feeds.example.com/rss.xml"
$table->enum('type', ['website', 'rss']); // Feed type
$table->string('language', 5)->default('en'); // Language code (en, nl, etc.)
$table->text('description')->nullable();
$table->json('settings')->nullable(); // Custom settings per feed type
$table->boolean('is_active')->default(true);
$table->timestamp('last_fetched_at')->nullable();
$table->timestamps();
$table->unique('url');
});
}
public function down(): void
{
Schema::dropIfExists('feeds');
}
};