Files

37 lines
1.2 KiB
PHP
Raw Permalink Normal View History

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('generations', function (Blueprint $table) {
$table->id();
$table->uuid('batch_id')->nullable()->index();
$table->enum('type', ['image', 'video', 'text']);
$table->string('model');
$table->text('prompt')->nullable();
$table->json('params')->nullable();
$table->enum('status', ['pending', 'processing', 'completed', 'failed'])->default('pending');
$table->uuid('runware_task_uuid')->nullable()->unique();
$table->decimal('cost_usd', 10, 6)->nullable();
$table->decimal('cost_eur', 10, 6)->nullable();
$table->boolean('cost_is_estimated')->default(false);
$table->string('output_path')->nullable();
$table->longText('output_text')->nullable();
$table->text('error')->nullable();
$table->timestamps();
$table->index('created_at');
});
}
public function down(): void
{
Schema::dropIfExists('generations');
}
};