This commit is contained in:
ct
2025-07-04 14:55:56 +08:00
parent b5ac848ba2
commit b3ffc261a3
8 changed files with 320 additions and 4 deletions

View File

@@ -0,0 +1,37 @@
<?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('user_meme_generations', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained()->onDelete('cascade');
$table->foreignId('meme_id')->nullable()->constrained()->onDelete('set null');
$table->uuid('job_id')->unique();
$table->text('prompt');
$table->enum('status', ['pending', 'processing', 'completed', 'failed'])->default('pending');
$table->integer('credits_to_be_charged');
$table->boolean('credits_are_processed')->default(false);
$table->timestamps();
$table->index(['user_id', 'job_id']);
$table->index('status');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('user_meme_generations');
}
};