Files
memefast/database/migrations/2025_06_19_051802_create_memes_table.php
2025-06-20 23:40:27 +08:00

60 lines
1.8 KiB
PHP

<?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
{
// {#488 ▼ // app/Http/Controllers/TestController.php:24
// +"caption": "thesis writing procrastination blues"
// +"meme_keywords": array:3 [▼
// 0 => "anxiety"
// 1 => "overwhelm"
// 2 => "imposter syndrome"
// ]
// +"background": "cluttered desk with piles of papers and a laptop"
// +"keywords": array:3 [▼
// 0 => "thesis"
// 1 => "anxiety"
// 2 => "breaks"
// ]
// }
Schema::create('memes', function (Blueprint $table) {
$table->id();
$table->enum('type', ['single_caption_meme_background'])->default('single_caption_meme_background');
$table->boolean('is_system');
$table->foreignId('category_id')->nullable();
$table->foreignId('user_id')->nullable();
$table->foreignId('meme_media_id')->nullable();
$table->foreignId('background_media_id')->nullable();
$table->enum('status', ['pending', 'completed'])->default('pending');
$table->text('prompt');
$table->string('caption')->nullable();
$table->json('meme_keywords')->nullable();
$table->string('background')->nullable();
$table->json('keywords');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('memes');
}
};