summaryrefslogtreecommitdiff
path: root/FS/FS
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2014-05-30 14:04:10 -0700
committerIvan Kohler <ivan@freeside.biz>2014-05-30 14:04:10 -0700
commit704df08c7f81c0ac0e828362f0b1304225757374 (patch)
tree63a4c1505524f5bdf4ec46c4b7e592c0be8878de /FS/FS
parent92f4d4407513140d5c78a689f340e5f4c1ffcbe5 (diff)
MySQL support, RT#28895
Diffstat (limited to 'FS/FS')
-rw-r--r--FS/FS/Schema.pm18
-rw-r--r--FS/FS/TicketSystem.pm28
-rw-r--r--FS/FS/tower_sector.pm2
3 files changed, 28 insertions, 20 deletions
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index 71bdec97c..95de553ac 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -3161,16 +3161,16 @@ sub tables_hashref {
'tower_sector' => {
'columns' => [
- 'sectornum', 'serial', '', '', '', '',
- 'towernum', 'int', '', '', '', '',
- 'sectorname', 'varchar', '', $char_d, '', '',
- 'ip_addr', 'varchar', 'NULL', 15, '', '',
- 'height', 'decimal', 'NULL', '', '', '',
- 'freq_mhz', 'int', 'NULL', '', '', '',
- 'direction', 'int', 'NULL', '', '', '',
- 'width', 'int', 'NULL', '', '', '',
+ 'sectornum', 'serial', '', '', '', '',
+ 'towernum', 'int', '', '', '', '',
+ 'sectorname', 'varchar', '', $char_d, '', '',
+ 'ip_addr', 'varchar', 'NULL', 15, '', '',
+ 'height', 'decimal', 'NULL', '', '', '',
+ 'freq_mhz', 'int', 'NULL', '', '', '',
+ 'direction', 'int', 'NULL', '', '', '',
+ 'width', 'int', 'NULL', '', '', '',
#downtilt etc? rfpath has profile files for devices/antennas you upload?
- 'range', 'decimal', 'NULL', '', '', '', #?
+ 'sector_range', 'decimal', 'NULL', '', '', '', #?
],
'primary_key' => 'sectornum',
'unique' => [ [ 'towernum', 'sectorname' ], [ 'ip_addr' ], ],
diff --git a/FS/FS/TicketSystem.pm b/FS/FS/TicketSystem.pm
index 3c972d0bd..7339d74f7 100644
--- a/FS/FS/TicketSystem.pm
+++ b/FS/FS/TicketSystem.pm
@@ -331,16 +331,24 @@ sub _upgrade_data {
}
}
- #Pg-specific
- my $cve_2013_3373_sql = q(
- UPDATE Tickets SET Subject = REPLACE(Subject,E'\n','')
- );
- #need this for mysql
- #UPDATE Tickets SET Subject = REPLACE(Subject,'\n','');
-
- my $cve_2013_3373_sth = $dbh->prepare( $cve_2013_3373_sql)
- or die $dbh->errstr;
- $cve_2013_3373_sth->execute or die $cve_2013_3373_sth->errstr;
+ my $cve_2013_3373_sql = '';
+ if ( driver_name =~ /^Pg/i ) {
+ $cve_2013_3373_sql = q(
+ UPDATE Tickets SET Subject = REPLACE(Subject,E'\n','')
+ );
+ } elsif ( driver_name =~ /^mysql/i ) {
+ $cve_2013_3373_sql = q(
+ UPDATE Tickets SET Subject = REPLACE(Subject,'\n','');
+ );
+ } else {
+ warn "WARNING: Don't know how to update RT Ticket Subjects for your database driver for CVE-2013-3373";
+ }
+ if ( $cve_2013_3373_sql ) {
+ my $cve_2013_3373_sth = $dbh->prepare($cve_2013_3373_sql)
+ or die $dbh->errstr;
+ $cve_2013_3373_sth->execute
+ or die $cve_2013_3373_sth->errstr;
+ }
# Remove dangling customer links, if any
my %target_pkey = ('cust_main' => 'custnum', 'cust_svc' => 'svcnum');
diff --git a/FS/FS/tower_sector.pm b/FS/FS/tower_sector.pm
index 70642fb18..4a6525ed3 100644
--- a/FS/FS/tower_sector.pm
+++ b/FS/FS/tower_sector.pm
@@ -112,7 +112,7 @@ sub check {
|| $self->ut_numbern('freq_mhz')
|| $self->ut_numbern('direction')
|| $self->ut_numbern('width')
- || $self->ut_floatn('range')
+ || $self->ut_floatn('sector_range')
;
return $error if $error;