28 lines
823 B
PHP
28 lines
823 B
PHP
<?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('templates', function (Blueprint $table) {
|
||
|
|
$table->id();
|
||
|
|
$table->string('name');
|
||
|
|
$table->text('body')->nullable();
|
||
|
|
$table->string('type')->nullable(); // blog, twitter, reddit, etc.
|
||
|
|
$table->string('title')->nullable();
|
||
|
|
$table->string('target')->nullable(); // e.g., subreddit for reddit
|
||
|
|
$table->json('placeholders')->nullable(); // JSON array of placeholder keys
|
||
|
|
$table->timestamps();
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
public function down(): void
|
||
|
|
{
|
||
|
|
Schema::dropIfExists('templates');
|
||
|
|
}
|
||
|
|
};
|