A free open source IT asset/license management system
add migration to restore defaults for labels
Godfrey Ma59f50372cb4
diff --git a/database/migrations/2026_07_22_235215_restore_default_label_sizes_if_zeroed_in_settings_table.php b/database/migrations/2026_07_22_235215_restore_default_label_sizes_if_zeroed_in_settings_table.phpnew file mode 100644index 0000000000..00b3c6d1fc--- /dev/null+++ b/database/migrations/2026_07_22_235215_restore_default_label_sizes_if_zeroed_in_settings_table.php@@ -0,0 +1,52 @@+<?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+ {+ DB::table('settings')+ ->where(function ($query) {+ $query+ ->where('labels_per_page', '<=', 0)+ ->orWhere('labels_width', '<=', 0)+ ->orWhere('labels_height', '<=', 0)+ ->orWhere('labels_fontsize', '<=', 0)+ ->orWhere('labels_pagewidth', '<=', 0)+ ->orWhere('labels_pageheight', '<=', 0)+ ->orWhereNull('labels_per_page')+ ->orWhereNull('labels_width')+ ->orWhereNull('labels_height')+ ->orWhereNull('labels_fontsize')+ ->orWhereNull('labels_pagewidth')+ ->orWhereNull('labels_pageheight');+ })+ ->update([+ 'labels_per_page' => 30,+ 'labels_width' => 2.625,+ 'labels_height' => 1.0,+ 'labels_pmargin_left' => 0.21975,+ 'labels_pmargin_right' => 0.21975,+ 'labels_pmargin_top' => 0.5,+ 'labels_pmargin_bottom' => 0.5,+ 'labels_display_bgutter' => 0.07,+ 'labels_display_sgutter' => 0.05,+ 'labels_fontsize' => 9,+ 'labels_pagewidth' => 8.5,+ 'labels_pageheight' => 11.0,+ ]);+ }++ /**+ * Reverse the migrations.+ */+ public function down(): void+ {+ }+};