RT# 80555 freeside_upgrade for invalid ip addresses
authorMitch Jackson <mitch@freeside.biz>
Wed, 11 Jul 2018 04:09:48 +0000 (23:09 -0500)
committerMitch Jackson <mitch@freeside.biz>
Fri, 19 Oct 2018 23:47:53 +0000 (19:47 -0400)
FS/FS/Upgrade.pm
FS/FS/svc_broadband.pm
FS/FS/svc_circuit.pm
FS/FS/svc_hardware.pm
FS/FS/svc_pbx.pm
FS/FS/tower_sector.pm

index f998a81..4e0e5c0 100644 (file)
@@ -526,6 +526,20 @@ sub upgrade_data {
 
     #upgrade part_event_condition_option agentnum to a multiple hash value
     'part_event_condition_option' =>[],
+
+    #fix ip format
+    'svc_circuit' => [],
+
+    #fix ip format
+    'svc_hardware' => [],
+
+    #fix ip format
+    'svc_pbx' => [],
+
+    #fix ip format
+    'tower_sector' => [],
+
+
   ;
 
   \%hash;
@@ -736,4 +750,3 @@ Sure.
 =cut
 
 1;
-
index 583030e..02136c5 100755 (executable)
@@ -515,6 +515,11 @@ sub _upgrade_data {
     #next SVC;
   }
 
+  require FS::Misc::FixIPFormat;
+  FS::Misc::FixIPFormat::fix_bad_addresses_in_table(
+      'svc_broadband', 'svcnum', 'ip_addr',
+  );
+
   '';
 }
 
index 7f49715..7f2ef80 100644 (file)
@@ -236,6 +236,17 @@ sub search_sql_addl_from {
   'LEFT JOIN circuit_type USING ( typenum )';
 }
 
+sub _upgrade_data {
+
+  require FS::Misc::FixIPFormat;
+  FS::Misc::FixIPFormat::fix_bad_addresses_in_table(
+      'svc_circuit', 'svcnum', 'endpoint_ip_addr',
+  );
+
+  '';
+
+}
+
 =back
 
 =head1 SEE ALSO
@@ -245,4 +256,3 @@ L<FS::Record>
 =cut
 
 1;
-
index 4bff483..019a564 100644 (file)
@@ -245,6 +245,17 @@ sub display_hw_addr {
     join(':', $self->hw_addr =~ /../g) : $self->hw_addr)
 }
 
+sub _upgrade_data {
+
+  require FS::Misc::FixIPFormat;
+  FS::Misc::FixIPFormat::fix_bad_addresses_in_table(
+      'svc_hardware', 'svcnum', 'ip_addr',
+  );
+
+  '';
+
+}
+
 =back
 
 =head1 SEE ALSO
@@ -254,4 +265,3 @@ L<FS::Record>, L<FS::svc_Common>, schema.html from the base documentation.
 =cut
 
 1;
-
index a5e181d..b0f6e8d 100644 (file)
@@ -387,6 +387,17 @@ sub sum_cdrs {
   qsearchs ( $psearch->{query} );
 }
 
+sub _upgrade_data {
+
+  require FS::Misc::FixIPFormat;
+  FS::Misc::FixIPFormat::fix_bad_addresses_in_table(
+      'svc_pbx', 'svcnum', 'ip_addr',
+  );
+
+  '';
+
+}
+
 =back
 
 =head1 BUGS
@@ -399,4 +410,3 @@ L<FS::cust_pkg>, schema.html from the base documentation.
 =cut
 
 1;
-
index 9f5b142..e2dad1b 100644 (file)
@@ -327,6 +327,17 @@ sub process_generate_coverage {
   die $error if $error;
 }
 
+sub _upgrade_data {
+
+  require FS::Misc::FixIPFormat;
+  FS::Misc::FixIPFormat::fix_bad_addresses_in_table(
+      'tower_sector', 'sectornum', 'ip_addr',
+  );
+
+  '';
+
+}
+
 =head1 BUGS
 
 =head1 SEE ALSO