Add (ai gen)

This commit is contained in:
2023-10-01 00:35:27 +08:00
parent 645d0f1d02
commit f02081e30c
79 changed files with 4816 additions and 1041 deletions

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

View File

@@ -0,0 +1,35 @@
<?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('shopee_seller_scrapes', function (Blueprint $table) {
$table->id();
$table->foreignId('category_id');
$table->string('seller');
$table->string('country_iso');
$table->bigInteger('epoch');
$table->string('filename');
$table->timestamp('last_ai_written_at');
$table->integer('write_counts')->default(0);
$table->timestamps();
$table->foreign('category')->references('id')->on('categories');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('shopee_seller_scrapes');
}
};

View File

@@ -0,0 +1,33 @@
<?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('shopee_seller_scraped_images', function (Blueprint $table) {
$table->id();
$table->foreignId('shopee_seller_scrape_id');
$table->string('original_name');
$table->string('image')->nullable();
$table->boolean('featured')->default(false);
$table->timestamps();
$table->foreign('shopee_seller_scrape_id')->references('id')->on('shopee_seller_scrapes');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('shopee_seller_scraped_images');
}
};

View File

@@ -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('ai_writeups', function (Blueprint $table) {
$table->id();
$table->string('source');
$table->string('source_url');
$table->foreignId('category_id');
$table->string('title');
$table->string('editor_format');
$table->mediumText('excerpt')->nullable();
$table->string('featured_image')->nullable();
$table->json('body')->nullable();
$table->double('cost', 5, 5);
$table->timestamps();
$table->foreign('category_id')->references('id')->on('categories');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('ai_writeups');
}
};

View File

@@ -0,0 +1,24 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
DB::statement("ALTER TABLE posts CHANGE COLUMN editor editor ENUM('editorjs', 'markdown') NOT NULL DEFAULT 'editorjs'");
}
/**
* Reverse the migrations.
*/
public function down(): void
{
DB::statement("ALTER TABLE posts CHANGE COLUMN editor editor ENUM('editorjs') NOT NULL DEFAULT 'editorjs'");
}
};