init
Some checks failed
Tests / PHP 8.2 (push) Has been cancelled
Tests / PHP 8.3 (push) Has been cancelled
Tests / PHP 8.4 (push) Has been cancelled

This commit is contained in:
jiangdong.cheng
2026-02-11 17:28:36 +08:00
parent dcb82557c7
commit aa16c9f8c2
162 changed files with 22333 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
<?php
declare(strict_types=1);
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('articles', function (Blueprint $table): void {
$table->id();
$table->foreignId('category_id')->nullable()->constrained()->nullOnDelete();
$table->foreignId('source_id')->nullable()->constrained()->nullOnDelete();
$table->string('title', 200);
$table->string('slug')->unique();
$table->string('excerpt', 320);
$table->longText('body');
$table->string('source_name', 160)->nullable();
$table->string('source_url', 2048)->nullable();
$table->string('source_level', 32)->default('unknown');
$table->timestamp('last_verified_at')->nullable();
$table->string('status', 32)->default('draft');
$table->boolean('is_stale')->default(false);
$table->text('stale_note')->nullable();
$table->string('seo_title', 180)->nullable();
$table->string('seo_description', 320)->nullable();
$table->string('h1', 180)->nullable();
$table->string('canonical_url', 2048)->nullable();
$table->timestamp('published_at')->nullable();
$table->timestamps();
$table->index(['status', 'published_at']);
$table->index(['is_stale', 'last_verified_at']);
$table->fullText(['title', 'excerpt', 'body']);
});
}
public function down(): void
{
Schema::dropIfExists('articles');
}
};