Add (initial): futurewalker code

This commit is contained in:
2023-11-20 00:15:18 +08:00
parent f8602cb456
commit 9ce3e5c82a
166 changed files with 15941 additions and 1072 deletions

View File

@@ -14,13 +14,19 @@ public function up(): void
Schema::create('serp_urls', function (Blueprint $table) {
$table->id();
$table->foreignId('news_serp_result_id');
$table->foreignId('category_id');
$table->string('category_name');
$table->foreignId('category_id')->nullable();
$table->string('category_name')->nullable();
$table->string('source')->default('serp');
$table->string('url');
$table->string('country_iso');
$table->string('title')->nullable();
$table->text('description')->nullable();
$table->boolean('picked')->default(false);
$table->boolean('processed')->default(false);
$table->boolean('crawled')->default(false);
$table->boolean('written')->default(false);
$table->json('suggestion_data')->nullable();
$table->datetime('url_posted_at');
$table->timestamp('serp_at')->nullable();
$table->enum('status', ['initial', 'processing', 'complete', 'failed', 'blocked', 'limited'])->default('initial');
$table->tinyInteger('process_status')->nullable();

View File

@@ -0,0 +1,34 @@
<?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('serp_url_researches', function (Blueprint $table) {
$table->id();
$table->foreignId('serp_url_id');
$table->string('url');
$table->string('query');
$table->text('content')->nullable();
$table->mediumText('main_image')->nullable();
$table->timestamps();
$table->foreign('serp_url_id')->references('id')->on('serp_urls');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('serp_url_researches');
}
};

View File

@@ -0,0 +1,34 @@
<?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('service_cost_usages', function (Blueprint $table) {
$table->id();
$table->double('cost', 5, 5);
$table->string('name');
$table->string('reference_1')->nullable();
$table->string('reference_2')->nullable();
$table->jsonb('output');
$table->text('input_1')->nullable();
$table->text('input_2')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('service_cost_usages');
}
};

View File

@@ -13,23 +13,25 @@ public function up(): void
{
Schema::create('posts', function (Blueprint $table) {
$table->id();
$table->foreignId('serp_url_id')->nullable();
$table->string('title')->nullable();
$table->string('short_title')->nullable();
$table->string('slug')->nullable();
$table->string('type')->nullable();
$table->string('main_keyword')->nullable();
$table->json('keywords')->nullable();
$table->mediumText('excerpt')->nullable();
$table->mediumText('bites')->nullable();
$table->mediumText('society_impact')->nullable();
$table->enum('society_impact_level', ['low','medium','high'])->default('low');
$table->foreignId('author_id')->nullable();
$table->boolean('featured')->default(false);
$table->string('featured_image')->nullable();
$table->mediumText('featured_image')->nullable();
$table->text('body')->nullable();
$table->json('metadata')->nullable();
$table->integer('views_count')->default(0);
$table->enum('status', ['publish', 'future', 'draft', 'private', 'trash'])->default('draft');
$table->timestamp('published_at')->nullable();
$table->timestamps();
$table->foreign('author_id')->references('id')->on('authors');
$table->foreign('serp_url_id')->references('id')->on('serp_urls');
});
}

View File

@@ -0,0 +1,30 @@
<?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('entities', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('slug');
$table->mediumText('description')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('entities');
}
};

View File

@@ -0,0 +1,32 @@
<?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('post_entities', function (Blueprint $table) {
$table->id();
$table->foreignId('post_id');
$table->foreignId('entity_id');
$table->timestamps();
$table->foreign('post_id')->references('id')->on('posts');
$table->foreign('entity_id')->references('id')->on('entities');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('post_entities');
}
};