bigIncrements('id'); $table->unsignedInteger('company_id')->nullable()->index(); $table->json('settings')->nullable(); $table->timestamps(); $table->unique(['company_id'], 'ticket_field_settings_company_unique'); }); } // Add custom_data JSON column to tickets for custom field values if (Schema::hasTable('tickets') && !Schema::hasColumn('tickets', 'custom_data')) { Schema::table('tickets', function (Blueprint $table) { $table->json('custom_data')->nullable(); }); } } public function down(): void { Schema::dropIfExists('ticket_field_settings'); if (Schema::hasTable('tickets') && Schema::hasColumn('tickets', 'custom_data')) { Schema::table('tickets', function (Blueprint $table) { $table->dropColumn('custom_data'); }); } } };