fix 1.2.9
This commit is contained in:
@@ -158,5 +158,31 @@ php artisan config:clear
|
||||
1. **`app/Models/AppSetting.php`**: Sostituito `file_exists(public_path('storage/' . $path))` con `Storage::disk('public')->exists($path)` e `asset('storage/' . $path)` con `Storage::disk('public')->url($path)`. Il controllo ora avviene direttamente su `storage/app/public/` (disk root), bypassando il symlink.
|
||||
2. **`app/Http/Controllers/ImpostazioniController.php`**: In `uploadLogo()`, aggiunta creazione automatica del symlink `public/storage → storage/app/public` se mancante, per garantire che il browser possa servire l'immagine.
|
||||
|
||||
## 2026-06-08 — Guardie Schema::hasColumn() aggiunte a 18 migration
|
||||
|
||||
**Problema**: 18 migration files aggiungevano colonne a tabelle esistenti senza `Schema::hasColumn()` guard. Se eseguite su DB dove le colonne già esistevano (es. da install.sql), causavano errore "Duplicate column".
|
||||
|
||||
**Fix**: Aggiunto `if (!Schema::hasColumn(...))` wrapper a ogni colonna aggiunta nelle seguenti migration:
|
||||
1. `2026_06_02_000002_add_uid_esterno_to_eventi_table.php` — `uid_esterno`
|
||||
2. `2026_05_12_000002_change_ruolo_to_multi.php` — `ruolo_ids` (up), `ruolo_id` (down)
|
||||
3. `2026_05_28_000001_add_storage_disk_to_documenti.php` — `storage_disk`
|
||||
4. `2026_05_27_113246_add_repository_id_to_documenti.php` — `repository_id`
|
||||
5. `2026_05_26_000003_add_log_falliti_to_mailing_messaggi.php` — `log_falliti`, `mittente_nome`, `mittente_email`
|
||||
6. `2026_05_27_000002_add_cartella_id_to_documenti.php` — `cartella_id`
|
||||
7. `2026_05_16_000004_add_signature_enabled_to_email_settings.php` — `signature_enabled`
|
||||
8. `2026_05_16_000003_add_signature_to_email_settings.php` — `signature`
|
||||
9. `2024_01_01_000017_add_occorrenza_mese_to_eventi.php` — `occorrenza_mese`
|
||||
10. `2024_01_01_000016_add_eventi_recurrence_fields.php` — `giorno_mese`, `mesi_recorrenza`, `mese_annuale`
|
||||
11. `2026_05_10_000002_add_acl_tables.php` — `permissions` (users)
|
||||
12. `2026_05_12_142009_add_location_to_eventi_table.php` — `luogo_indirizzo`, `luogo_url_maps`
|
||||
13. `2026_05_12_000003_change_responsabile_to_multi.php` — `responsabile_ids` (up), `responsabile_id` (down)
|
||||
14. `2024_01_01_000023_add_is_default_to_viste_report_table.php` — `is_default`
|
||||
15. `2024_01_01_000024_add_user_id_to_mailing_lists_table.php` — `user_id`
|
||||
16. `2026_05_12_000001_create_ruoli_table.php` — `ruolo_id` (gruppo_individuo) + data migration annessa
|
||||
17. `2024_01_01_000021_add_user_id_to_documenti_table.php` — `user_id`
|
||||
18. `2024_01_01_000013_add_numero_documento_to_individui_table.php` — `numero_documento`
|
||||
|
||||
Tutte verificate con `php -l` (nessun errore di sintassi).
|
||||
|
||||
## Prossimi Passi
|
||||
- *(nessuno — in attesa di nuove richieste)*
|
||||
|
||||
@@ -8,9 +8,11 @@ return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('individui', function (Blueprint $table) {
|
||||
$table->string('numero_documento', 50)->nullable()->after('tipo_documento');
|
||||
});
|
||||
if (!Schema::hasColumn('individui', 'numero_documento')) {
|
||||
Schema::table('individui', function (Blueprint $table) {
|
||||
$table->string('numero_documento', 50)->nullable()->after('tipo_documento');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
|
||||
@@ -8,11 +8,13 @@ return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('eventi', function (Blueprint $table) {
|
||||
$table->string('giorno_mese')->nullable()->after('giorno_settimana');
|
||||
$table->string('mesi_recorrenza')->nullable()->after('giorno_mese');
|
||||
$table->string('mese_annuale')->nullable()->after('mesi_recorrenza');
|
||||
});
|
||||
if (!Schema::hasColumn('eventi', 'giorno_mese')) {
|
||||
Schema::table('eventi', function (Blueprint $table) {
|
||||
$table->string('giorno_mese')->nullable()->after('giorno_settimana');
|
||||
$table->string('mesi_recorrenza')->nullable()->after('giorno_mese');
|
||||
$table->string('mese_annuale')->nullable()->after('mesi_recorrenza');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
|
||||
@@ -8,9 +8,11 @@ return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('eventi', function (Blueprint $table) {
|
||||
$table->unsignedTinyInteger('occorrenza_mese')->nullable()->after('giorno_mese');
|
||||
});
|
||||
if (!Schema::hasColumn('eventi', 'occorrenza_mese')) {
|
||||
Schema::table('eventi', function (Blueprint $table) {
|
||||
$table->unsignedTinyInteger('occorrenza_mese')->nullable()->after('giorno_mese');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
|
||||
@@ -8,9 +8,11 @@ return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('documenti', function (Blueprint $table) {
|
||||
$table->foreignId('user_id')->nullable()->constrained('users')->onDelete('set null')->after('tenant_id');
|
||||
});
|
||||
if (!Schema::hasColumn('documenti', 'user_id')) {
|
||||
Schema::table('documenti', function (Blueprint $table) {
|
||||
$table->foreignId('user_id')->nullable()->constrained('users')->onDelete('set null')->after('tenant_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
|
||||
@@ -8,10 +8,12 @@ return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('viste_report', function (Blueprint $table) {
|
||||
$table->boolean('is_default')->default(false)->after('nome');
|
||||
$table->index('is_default');
|
||||
});
|
||||
if (!Schema::hasColumn('viste_report', 'is_default')) {
|
||||
Schema::table('viste_report', function (Blueprint $table) {
|
||||
$table->boolean('is_default')->default(false)->after('nome');
|
||||
$table->index('is_default');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
|
||||
@@ -8,10 +8,12 @@ return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('mailing_lists', function (Blueprint $table) {
|
||||
$table->foreignId('user_id')->nullable()->constrained('users')->onDelete('set null')->after('tenant_id');
|
||||
$table->index('user_id');
|
||||
});
|
||||
if (!Schema::hasColumn('mailing_lists', 'user_id')) {
|
||||
Schema::table('mailing_lists', function (Blueprint $table) {
|
||||
$table->foreignId('user_id')->nullable()->constrained('users')->onDelete('set null')->after('tenant_id');
|
||||
$table->index('user_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
|
||||
@@ -8,9 +8,11 @@ return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->json('permissions')->nullable()->after('is_admin');
|
||||
});
|
||||
if (!Schema::hasColumn('users', 'permissions')) {
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->json('permissions')->nullable()->after('is_admin');
|
||||
});
|
||||
}
|
||||
|
||||
Schema::create('activity_logs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
@@ -38,25 +38,27 @@ return new class extends Migration
|
||||
]);
|
||||
}
|
||||
|
||||
Schema::table('gruppo_individuo', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('ruolo_id')->nullable()->after('ruolo_nel_gruppo');
|
||||
$table->foreign('ruolo_id')->references('id')->on('ruoli')->onDelete('set null');
|
||||
$table->index('ruolo_id');
|
||||
});
|
||||
if (!Schema::hasColumn('gruppo_individuo', 'ruolo_id')) {
|
||||
Schema::table('gruppo_individuo', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('ruolo_id')->nullable()->after('ruolo_nel_gruppo');
|
||||
$table->foreign('ruolo_id')->references('id')->on('ruoli')->onDelete('set null');
|
||||
$table->index('ruolo_id');
|
||||
});
|
||||
|
||||
$ruoliMap = DB::table('ruoli')->pluck('id', 'nome')->toArray();
|
||||
$ruoliMap = DB::table('ruoli')->pluck('id', 'nome')->toArray();
|
||||
|
||||
$pivotRecords = DB::table('gruppo_individuo')
|
||||
->whereNotNull('ruolo_nel_gruppo')
|
||||
->where('ruolo_nel_gruppo', '!=', '')
|
||||
->distinct()
|
||||
->pluck('ruolo_nel_gruppo');
|
||||
$pivotRecords = DB::table('gruppo_individuo')
|
||||
->whereNotNull('ruolo_nel_gruppo')
|
||||
->where('ruolo_nel_gruppo', '!=', '')
|
||||
->distinct()
|
||||
->pluck('ruolo_nel_gruppo');
|
||||
|
||||
foreach ($pivotRecords as $ruoloNome) {
|
||||
if (isset($ruoliMap[$ruoloNome])) {
|
||||
DB::table('gruppo_individuo')
|
||||
->where('ruolo_nel_gruppo', $ruoloNome)
|
||||
->update(['ruolo_id' => $ruoliMap[$ruoloNome]]);
|
||||
foreach ($pivotRecords as $ruoloNome) {
|
||||
if (isset($ruoliMap[$ruoloNome])) {
|
||||
DB::table('gruppo_individuo')
|
||||
->where('ruolo_nel_gruppo', $ruoloNome)
|
||||
->update(['ruolo_id' => $ruoliMap[$ruoloNome]]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,9 +13,11 @@ return new class extends Migration
|
||||
$table->dropColumn('ruolo_id');
|
||||
});
|
||||
|
||||
Schema::table('gruppo_individuo', function (Blueprint $table) {
|
||||
$table->json('ruolo_ids')->nullable()->after('individuo_id');
|
||||
});
|
||||
if (!Schema::hasColumn('gruppo_individuo', 'ruolo_ids')) {
|
||||
Schema::table('gruppo_individuo', function (Blueprint $table) {
|
||||
$table->json('ruolo_ids')->nullable()->after('individuo_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
@@ -24,9 +26,11 @@ return new class extends Migration
|
||||
$table->dropColumn('ruolo_ids');
|
||||
});
|
||||
|
||||
Schema::table('gruppo_individuo', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('ruolo_id')->nullable()->after('individuo_id');
|
||||
$table->foreign('ruolo_id')->references('id')->on('ruoli')->onDelete('set null');
|
||||
});
|
||||
if (!Schema::hasColumn('gruppo_individuo', 'ruolo_id')) {
|
||||
Schema::table('gruppo_individuo', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('ruolo_id')->nullable()->after('individuo_id');
|
||||
$table->foreign('ruolo_id')->references('id')->on('ruoli')->onDelete('set null');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -13,9 +13,11 @@ return new class extends Migration
|
||||
$table->dropColumn('responsabile_id');
|
||||
});
|
||||
|
||||
Schema::table('gruppi', function (Blueprint $table) {
|
||||
$table->json('responsabile_ids')->nullable()->after('diocesi_id');
|
||||
});
|
||||
if (!Schema::hasColumn('gruppi', 'responsabile_ids')) {
|
||||
Schema::table('gruppi', function (Blueprint $table) {
|
||||
$table->json('responsabile_ids')->nullable()->after('diocesi_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
@@ -24,9 +26,11 @@ return new class extends Migration
|
||||
$table->dropColumn('responsabile_ids');
|
||||
});
|
||||
|
||||
Schema::table('gruppi', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('responsabile_id')->nullable()->after('diocesi_id');
|
||||
$table->foreign('responsabile_id')->references('id')->on('individui')->onDelete('set null');
|
||||
});
|
||||
if (!Schema::hasColumn('gruppi', 'responsabile_id')) {
|
||||
Schema::table('gruppi', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('responsabile_id')->nullable()->after('diocesi_id');
|
||||
$table->foreign('responsabile_id')->references('id')->on('individui')->onDelete('set null');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -8,10 +8,12 @@ return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('eventi', function (Blueprint $table) {
|
||||
$table->string('luogo_indirizzo', 500)->nullable()->after('note');
|
||||
$table->text('luogo_url_maps')->nullable()->after('luogo_indirizzo');
|
||||
});
|
||||
if (!Schema::hasColumn('eventi', 'luogo_indirizzo')) {
|
||||
Schema::table('eventi', function (Blueprint $table) {
|
||||
$table->string('luogo_indirizzo', 500)->nullable()->after('note');
|
||||
$table->text('luogo_url_maps')->nullable()->after('luogo_indirizzo');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
|
||||
@@ -8,9 +8,11 @@ return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('email_settings', function (Blueprint $table) {
|
||||
$table->longText('signature')->nullable()->after('reply_to');
|
||||
});
|
||||
if (!Schema::hasColumn('email_settings', 'signature')) {
|
||||
Schema::table('email_settings', function (Blueprint $table) {
|
||||
$table->longText('signature')->nullable()->after('reply_to');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
|
||||
@@ -8,9 +8,11 @@ return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('email_settings', function (Blueprint $table) {
|
||||
$table->boolean('signature_enabled')->default(true)->after('signature');
|
||||
});
|
||||
if (!Schema::hasColumn('email_settings', 'signature_enabled')) {
|
||||
Schema::table('email_settings', function (Blueprint $table) {
|
||||
$table->boolean('signature_enabled')->default(true)->after('signature');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
|
||||
@@ -10,11 +10,13 @@ return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('mailing_messaggi', function (Blueprint $table) {
|
||||
$table->json('log_falliti')->nullable()->after('invii_falliti');
|
||||
$table->string('mittente_nome')->nullable()->after('log_falliti');
|
||||
$table->string('mittente_email')->nullable()->after('mittente_nome');
|
||||
});
|
||||
if (!Schema::hasColumn('mailing_messaggi', 'log_falliti')) {
|
||||
Schema::table('mailing_messaggi', function (Blueprint $table) {
|
||||
$table->json('log_falliti')->nullable()->after('invii_falliti');
|
||||
$table->string('mittente_nome')->nullable()->after('log_falliti');
|
||||
$table->string('mittente_email')->nullable()->after('mittente_nome');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
|
||||
@@ -8,9 +8,11 @@ return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('documenti', function (Blueprint $table) {
|
||||
$table->foreignId('cartella_id')->nullable()->constrained('documenti_cartelle')->onDelete('set null');
|
||||
});
|
||||
if (!Schema::hasColumn('documenti', 'cartella_id')) {
|
||||
Schema::table('documenti', function (Blueprint $table) {
|
||||
$table->foreignId('cartella_id')->nullable()->constrained('documenti_cartelle')->onDelete('set null');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
|
||||
@@ -8,13 +8,15 @@ return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('documenti', function (Blueprint $table) {
|
||||
$table->foreignId('repository_id')
|
||||
->nullable()
|
||||
->constrained('storage_repositories')
|
||||
->nullOnDelete()
|
||||
->after('cartella_id');
|
||||
});
|
||||
if (!Schema::hasColumn('documenti', 'repository_id')) {
|
||||
Schema::table('documenti', function (Blueprint $table) {
|
||||
$table->foreignId('repository_id')
|
||||
->nullable()
|
||||
->constrained('storage_repositories')
|
||||
->nullOnDelete()
|
||||
->after('cartella_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
|
||||
@@ -10,9 +10,11 @@ return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('documenti', function (Blueprint $table) {
|
||||
$table->string('storage_disk', 50)->nullable()->after('repository_id');
|
||||
});
|
||||
if (!Schema::hasColumn('documenti', 'storage_disk')) {
|
||||
Schema::table('documenti', function (Blueprint $table) {
|
||||
$table->string('storage_disk', 50)->nullable()->after('repository_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
|
||||
@@ -10,10 +10,12 @@ return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('eventi', function (Blueprint $table) {
|
||||
$table->string('uid_esterno', 500)->nullable()->after('luogo_url_maps');
|
||||
$table->index('uid_esterno');
|
||||
});
|
||||
if (!Schema::hasColumn('eventi', 'uid_esterno')) {
|
||||
Schema::table('eventi', function (Blueprint $table) {
|
||||
$table->string('uid_esterno', 500)->nullable()->after('luogo_url_maps');
|
||||
$table->index('uid_esterno');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
|
||||
Vendored
+2
-2
@@ -3,7 +3,7 @@
|
||||
'name' => 'laravel/laravel',
|
||||
'pretty_version' => 'dev-main',
|
||||
'version' => 'dev-main',
|
||||
'reference' => '90093a086b35dce8edd97fce09d32d2be42853e8',
|
||||
'reference' => '7d7d384a0d719ca6fa83e01e50577b94c877e676',
|
||||
'type' => 'project',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
@@ -427,7 +427,7 @@
|
||||
'laravel/laravel' => array(
|
||||
'pretty_version' => 'dev-main',
|
||||
'version' => 'dev-main',
|
||||
'reference' => '90093a086b35dce8edd97fce09d32d2be42853e8',
|
||||
'reference' => '7d7d384a0d719ca6fa83e01e50577b94c877e676',
|
||||
'type' => 'project',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
|
||||
Reference in New Issue
Block a user