Files
ai-web/database/migrations/2026_02_11_100200_create_sources_table.php
jiangdong.cheng aa16c9f8c2
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
init
2026-02-11 17:28:36 +08:00

33 lines
931 B
PHP

<?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('sources', function (Blueprint $table): void {
$table->id();
$table->string('name', 150);
$table->string('domain', 255)->unique();
$table->string('type', 32)->default('media');
$table->string('trust_level', 32)->default('trusted_media');
$table->boolean('is_whitelisted')->default(true);
$table->boolean('crawl_allowed')->default(false);
$table->text('note')->nullable();
$table->timestamps();
$table->index(['is_whitelisted', 'trust_level']);
});
}
public function down(): void
{
Schema::dropIfExists('sources');
}
};