33 lines
931 B
PHP
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');
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|