fix mailing an email

This commit is contained in:
2026-06-23 08:05:51 +02:00
parent c5127da750
commit def8d22544
2479 changed files with 325393 additions and 781 deletions
@@ -0,0 +1,36 @@
<?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
{
if (!Schema::hasTable('email_settings')) {
return;
}
if (!Schema::hasColumn('email_settings', 'from_email')) {
Schema::table('email_settings', function (Blueprint $table) {
$table->string('from_email')->nullable()->after('email_name');
});
}
if (!Schema::hasColumn('email_settings', 'from_name')) {
Schema::table('email_settings', function (Blueprint $table) {
$table->string('from_name')->nullable()->after('from_email');
});
}
}
public function down(): void
{
Schema::table('email_settings', function (Blueprint $table) {
$table->dropColumn(['from_email', 'from_name']);
});
}
};
@@ -0,0 +1,31 @@
<?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
{
if (!Schema::hasTable('gruppo_contatti')) {
Schema::create('gruppo_contatti', function (Blueprint $table) {
$table->id();
$table->foreignId('gruppo_id')->constrained('gruppi')->onDelete('cascade');
$table->string('tipo');
$table->string('valore');
$table->string('etichetta')->nullable();
$table->boolean('is_primary')->default(false);
$table->timestamps();
$table->index('gruppo_id');
});
}
}
public function down(): void
{
Schema::dropIfExists('gruppo_contatti');
}
};
@@ -0,0 +1,27 @@
<?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
{
if (!Schema::hasTable('diocesi_gruppo')) {
Schema::create('diocesi_gruppo', function (Blueprint $table) {
$table->id();
$table->foreignId('gruppo_id')->constrained('gruppi')->onDelete('cascade');
$table->foreignId('diocesi_id')->constrained('diocesi')->onDelete('cascade');
$table->unique(['gruppo_id', 'diocesi_id']);
});
}
}
public function down(): void
{
Schema::dropIfExists('diocesi_gruppo');
}
};
@@ -0,0 +1,27 @@
<?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('firme', function (Blueprint $table) {
$table->id();
$table->foreignId('email_setting_id')->constrained()->cascadeOnDelete();
$table->string('nome', 255);
$table->longText('contenuto_html')->nullable();
$table->boolean('is_default')->default(false);
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('firme');
}
};
@@ -0,0 +1,25 @@
<?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::table('mailing_lists', function (Blueprint $table) {
$table->foreignId('firma_id')->nullable()->constrained('firme')->nullOnDelete();
});
}
public function down(): void
{
Schema::table('mailing_lists', function (Blueprint $table) {
$table->dropForeign(['firma_id']);
$table->dropColumn('firma_id');
});
}
};
@@ -0,0 +1,25 @@
<?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::table('mailing_messaggi', function (Blueprint $table) {
$table->foreignId('firma_id')->nullable()->constrained('firme')->nullOnDelete();
});
}
public function down(): void
{
Schema::table('mailing_messaggi', function (Blueprint $table) {
$table->dropForeign(['firma_id']);
$table->dropColumn('firma_id');
});
}
};
@@ -0,0 +1,29 @@
<?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
{
if (!Schema::hasTable('sessions')) {
Schema::create('sessions', function (Blueprint $table): void {
$table->string('id')->primary();
$table->foreignId('user_id')->nullable()->index();
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
$table->longText('payload');
$table->integer('last_activity')->index();
});
}
}
public function down(): void
{
Schema::dropIfExists('sessions');
}
};
@@ -0,0 +1,25 @@
<?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::table('mailing_lists', function (Blueprint $table) {
$table->foreignId('sender_account_id')->nullable()->constrained('sender_accounts')->nullOnDelete();
});
}
public function down(): void
{
Schema::table('mailing_lists', function (Blueprint $table) {
$table->dropForeign(['sender_account_id']);
$table->dropColumn('sender_account_id');
});
}
};