This commit is contained in:
2023-11-28 04:39:36 +08:00
parent a9ac0e48b3
commit dc37274b6c
86 changed files with 2106 additions and 191 deletions

View File

@@ -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');
});
}

View File

@@ -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');
});
}

View File

@@ -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)');
}
/**

View File

@@ -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');
}
};

View File

@@ -45,8 +45,8 @@ public function run(): void
['name' => 'Content Generation', 'emoji' => '📝', 'is_top' => true],
['name' => 'Support', 'emoji' => '🛠️', 'is_top' => false],
['name' => 'Health', 'emoji' => '🍏', 'is_top' => false],
['name' => 'Networking', 'emoji' => '🔗', 'is_top' => false],
['name' => 'Personal Assistance', 'emoji' => '🤝', 'is_top' => false],
['name' => 'Networking', 'emoji' => '🤝', 'is_top' => false],
['name' => 'Personal Assistance', 'emoji' => '📱', 'is_top' => false],
['name' => 'Planning', 'emoji' => '📅', 'is_top' => false],
['name' => 'Project Management', 'emoji' => '📈', 'is_top' => false],
['name' => 'Reporting', 'emoji' => '📑', 'is_top' => false],