Add (keyword model)
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?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::create('rss_post_keywords', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('rss_post_id');
|
||||
$table->enum('type',['keyword','entity']);
|
||||
$table->boolean('is_main')->default(false);
|
||||
$table->string('value');
|
||||
$table->string('value_lowercased');
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('rss_post_id')->references('id')->on('rss_posts');
|
||||
|
||||
$table->index('value');
|
||||
$table->index('value_lowercased');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('rss_post_keywords');
|
||||
}
|
||||
};
|
||||
@@ -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_posts', function (Blueprint $table) {
|
||||
$table->boolean('keyword_saved')->default(false);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('rss_posts', function (Blueprint $table) {
|
||||
$table->dropColumn('keyword_saved');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user