Update (keywords): new logic

This commit is contained in:
2023-11-23 02:15:41 +08:00
parent d2c2059531
commit b2762ecef2
15 changed files with 211 additions and 198 deletions

View File

@@ -14,7 +14,7 @@ public function up(): void
Schema::create('rss_post_keywords', function (Blueprint $table) {
$table->id();
$table->foreignId('rss_post_id');
$table->enum('type',['keyword','entity']);
$table->enum('type', ['keyword', 'entity']);
$table->boolean('is_main')->default(false);
$table->string('value');
$table->string('value_lowercased');

View File

@@ -12,7 +12,7 @@
public function up(): void
{
Schema::table('rss_posts', function (Blueprint $table) {
$table->boolean('keyword_saved')->default(false);
$table->boolean('keyword_saved')->default(false);
});
}

View File

@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('rss_post_keywords', function (Blueprint $table) {
$table->index('created_at');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('rss_post_keywords', function (Blueprint $table) {
$table->dropIndex(['created_at']);
});
}
};