Files
preregister/database/migrations/2024_01_01_100002_create_subscribers_table.php

33 lines
926 B
PHP

<?php
declare(strict_types=1);
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('subscribers', function (Blueprint $table) {
$table->id();
$table->foreignId('preregistration_page_id')->constrained()->cascadeOnDelete();
$table->string('first_name');
$table->string('last_name');
$table->string('email');
$table->string('phone')->nullable();
$table->boolean('synced_to_mailwizz')->default(false);
$table->timestamp('synced_at')->nullable();
$table->timestamps();
$table->unique(['preregistration_page_id', 'email']);
});
}
public function down(): void
{
Schema::dropIfExists('subscribers');
}
};