Файл: database/migrations/2025_04_24_020623_create_search_table.php
Строк: 25
<?php
use IlluminateDatabaseMigrationsMigration;
use IlluminateDatabaseSchemaBlueprint;
use IlluminateSupportFacadesSchema;
return new class extends Migration {
public function up(): void
{
Schema::create('search', function (Blueprint $table) {
$table->id();
$table->text('text');
$table->string('relate_type', 20);
$table->integer('relate_id');
$table->dateTime('created_at')->nullable();
$table->fullText(['text']);
$table->unique(['relate_type', 'relate_id']);
$table->index(['relate_type', 'created_at']);
$table->index('created_at');
});
}
public function down(): void
{
Schema::dropIfExists('search');
}
};