Snapshot of main at 9f39a6e1e (2026-11-02)

This commit is contained in:
Ronald Huynen committed 2026-11-02 10:41:47 +01:00
commit 6ccf1792d7
2580 files changed
+1040202

No files matched your search

@@ -0,0 +1,45 @@
<?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('mailings', function (Blueprint $table) {
$table->id();
$table->string('title', 255);
$table->enum('type', ['local_newsletter', 'general_newsletter', 'system_message']);
$table->string('subject', 255);
$table->json('content_blocks')->nullable(); // Array of selected post IDs and their order
$table->datetime('scheduled_at')->nullable();
$table->datetime('sent_at')->nullable();
$table->enum('status', ['draft', 'scheduled', 'sending', 'sent', 'cancelled'])->default('draft');
$table->integer('recipients_count')->default(0);
$table->integer('sent_count')->default(0);
$table->integer('failed_count')->default(0);
$table->integer('bounced_count')->default(0);
// Polymorphic relationship for created_by
$table->unsignedBigInteger('created_by_id');
$table->string('created_by_type');
$table->index(['created_by_id', 'created_by_type']);
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('mailings');
}
};