fix 1.2.9
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user