34 lines
1,018 B
PHP
34 lines
1,018 B
PHP
<?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();
|
|
$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');
|
|
}
|
|
};
|