2026-04-26 02:48:39 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
use App\Enums\PageStatusEnum;
|
|
|
|
|
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('pages', function (Blueprint $table) {
|
|
|
|
|
$table->id();
|
|
|
|
|
$table->text('url')->unique();
|
|
|
|
|
$table->string('status')->default(PageStatusEnum::Discovered->value)->index();
|
2026-04-26 12:53:21 +02:00
|
|
|
$table->string('language', 35)->nullable()->index();
|
2026-04-28 00:13:14 +02:00
|
|
|
$table->decimal('language_confidence', 4, 3)->nullable();
|
2026-04-26 02:48:39 +02:00
|
|
|
$table->string('title')->nullable();
|
|
|
|
|
$table->foreignId('instance_id')
|
|
|
|
|
->nullable()
|
|
|
|
|
->constrained('fedi_discover_instances')
|
|
|
|
|
->nullOnDelete();
|
|
|
|
|
$table->timestampTz('posted_at')->nullable();
|
|
|
|
|
$table->timestampTz('fetched_at')->nullable();
|
|
|
|
|
$table->timestampTz('failed_at')->nullable();
|
|
|
|
|
$table->timestampsTz();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function down(): void
|
|
|
|
|
{
|
|
|
|
|
Schema::dropIfExists('pages');
|
|
|
|
|
}
|
|
|
|
|
};
|