Sync
This commit is contained in:
@@ -17,10 +17,14 @@ public function up(): void
|
||||
$table->foreignId('category_id');
|
||||
$table->foreignId('url_to_crawl_id');
|
||||
|
||||
$table->string('view_count')->default(0);
|
||||
|
||||
$table->string('screenshot_img')->nullable();
|
||||
|
||||
$table->boolean('is_ai_tool')->default(true);
|
||||
$table->string('tool_name');
|
||||
$table->string('slug');
|
||||
$table->string('external_url');
|
||||
|
||||
$table->string('is_app_web_both');
|
||||
$table->text('tagline')->nullable();
|
||||
@@ -32,6 +36,9 @@ public function up(): void
|
||||
|
||||
$table->foreign('category_id')->references('id')->on('categories');
|
||||
$table->foreign('url_to_crawl_id')->references('id')->on('url_to_crawls');
|
||||
|
||||
$table->index('view_count');
|
||||
$table->index('slug');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@ public function up(): void
|
||||
|
||||
$table->foreign('category_id')->references('id')->on('categories');
|
||||
$table->foreign('ai_tool_id')->references('id')->on('ai_tools');
|
||||
|
||||
$table->index('ai_tool_id');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
@@ -25,7 +26,11 @@ public function up(): void
|
||||
|
||||
$table->foreign('ai_tool_id')->references('id')->on('ai_tools');
|
||||
$table->foreign('category_id')->references('id')->on('categories');
|
||||
|
||||
});
|
||||
|
||||
DB::statement('CREATE INDEX search_embeddings_embedding_idx ON search_embeddings USING ivfflat (embedding vector_l2_ops) WITH (lists = 100)');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('search_results', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('query');
|
||||
$table->vector('embedding', 384)->nullable();
|
||||
$table->datetime('indexed_at')->nullable();
|
||||
$table->bigInteger('counts')->default(1);
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
DB::statement('CREATE INDEX search_results_embedding_idx ON search_results USING ivfflat (embedding vector_l2_ops) WITH (lists = 100)');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('search_results');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user