Add (article): ai gen, front views
This commit is contained in:
@@ -14,8 +14,11 @@ public function up(): void
|
||||
Schema::create('categories', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('short_name');
|
||||
$table->string('slug')->nullable();
|
||||
$table->boolean('enabled')->default(true);
|
||||
$table->bigInteger('counts')->default(0);
|
||||
$table->timestamp('serp_at')->nullable();
|
||||
$table->timestamps();
|
||||
$table->nestedSet();
|
||||
$table->index(['name', 'slug']);
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<?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('news_serp_results', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('category_id')->nullable();
|
||||
$table->string('category_name')->nullable();
|
||||
$table->string('serp_provider');
|
||||
$table->string('serp_se');
|
||||
$table->string('serp_se_type');
|
||||
$table->string('serp_keyword');
|
||||
$table->string('serp_country_iso');
|
||||
$table->decimal('serp_cost')->nullable();
|
||||
$table->unsignedInteger('result_count')->nullable();
|
||||
$table->string('filename');
|
||||
$table->enum('status', ['initial'/* other potential statuses */]);
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('news_serp_results');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,41 @@
|
||||
<?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_urls', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('news_serp_result_id');
|
||||
$table->foreignId('category_id');
|
||||
$table->string('category_name');
|
||||
$table->string('source')->default('serp');
|
||||
$table->string('url');
|
||||
$table->string('country_iso');
|
||||
$table->string('title')->nullable();
|
||||
$table->text('description')->nullable();
|
||||
$table->timestamp('serp_at')->nullable();
|
||||
$table->enum('status', ['initial', 'processing', 'complete', 'failed', 'blocked', 'limited'])->default('initial');
|
||||
$table->tinyInteger('process_status')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade');
|
||||
$table->foreign('news_serp_result_id')->references('id')->on('news_serp_results')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('serp_urls');
|
||||
}
|
||||
};
|
||||
@@ -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('authors', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('avatar')->nullable();
|
||||
$table->string('bio')->nullable();
|
||||
$table->boolean('enabled')->default(true);
|
||||
$table->boolean('public')->default(true);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('authors');
|
||||
}
|
||||
};
|
||||
43
database/migrations/2023_09_22_165123_create_posts_table.php
Normal file
43
database/migrations/2023_09_22_165123_create_posts_table.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?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('posts', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$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->foreignId('author_id')->nullable();
|
||||
$table->boolean('featured')->default(false);
|
||||
$table->string('featured_image')->nullable();
|
||||
$table->text('body')->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');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('posts');
|
||||
}
|
||||
};
|
||||
@@ -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_categories', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('post_id');
|
||||
$table->foreignId('category_id');
|
||||
|
||||
$table->foreign('post_id')->references('id')->on('posts');
|
||||
$table->foreign('category_id')->references('id')->on('categories');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('post_categories');
|
||||
}
|
||||
};
|
||||
32
database/migrations/2023_09_24_144901_create_jobs_table.php
Normal file
32
database/migrations/2023_09_24_144901_create_jobs_table.php
Normal 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('jobs', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('queue')->index();
|
||||
$table->longText('payload');
|
||||
$table->unsignedTinyInteger('attempts');
|
||||
$table->unsignedInteger('reserved_at')->nullable();
|
||||
$table->unsignedInteger('available_at');
|
||||
$table->unsignedInteger('created_at');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('jobs');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user