Skip to content

A free open source IT asset/license management system

Make the format field bigger - large regexes can break

snipe8b22b7c5c800
diff --git a/database/migrations/2026_07_17_000003_widen_custom_fields_format_column.php b/database/migrations/2026_07_17_000003_widen_custom_fields_format_column.php
new file mode 100644
index 0000000000..a3be428c17
--- /dev/null
+++ b/database/migrations/2026_07_17_000003_widen_custom_fields_format_column.php
@@ -0,0 +1,26 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+ // Widen custom_fields.format from varchar(191) to TEXT. Custom regex
+ // formats can easily exceed 191 chars (character classes + anchors +
+ // grouping quickly add up), and hitting the ceiling truncates the
+ // regex silently on save, breaking validation on that field's values.
+ public function up(): void
+ {
+ Schema::table('custom_fields', function (Blueprint $table) {
+ $table->text('format')->change();
+ });
+ }
+
+ public function down(): void
+ {
+ Schema::table('custom_fields', function (Blueprint $table) {
+ $table->string('format', 191)->change();
+ });
+ }
+};