gutendex processing implementation
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?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('books', function (Blueprint $table) {
|
||||
$table->integer('gutenberg_id')->unique()->nullable()->after('id');
|
||||
$table->string('source', 50)->default('manual')->after('gutenberg_id');
|
||||
$table->text('full_text_url')->nullable()->after('cover_image');
|
||||
$table->string('language', 10)->nullable()->after('full_text_url');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('books', function (Blueprint $table) {
|
||||
$table->dropColumn(['gutenberg_id', 'source', 'full_text_url', 'language']);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -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::table('summaries', function (Blueprint $table) {
|
||||
$table->enum('processing_status', ['pending', 'processing', 'completed', 'failed'])
|
||||
->default('pending')
|
||||
->after('book_id');
|
||||
$table->text('processing_error')->nullable()->after('processing_status');
|
||||
$table->timestamp('processed_at')->nullable()->after('processing_error');
|
||||
$table->string('model_used', 100)->nullable()->after('processed_at');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('summaries', function (Blueprint $table) {
|
||||
$table->dropColumn(['processing_status', 'processing_error', 'processed_at', 'model_used']);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user