Files
ai-web/database/migrations/2026_02_11_100200_create_sources_table.php

33 lines
931 B
PHP
Raw Permalink Normal View History

2026-02-11 17:28:36 +08:00
<?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');
}
};