X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXSql%2FSQLite.pm;h=36bcc46da72554ae53721a85b147f8f6868b0e6b;hb=c83b1ca22765fc07e5adcdc8dac24cbd066c9b95;hp=14eb0621f96e85bbc3805daecd1200850041e168;hpb=427bd0165d0b8bec0e93cc2b262fcbe0d3cb5855;p=spider.git diff --git a/perl/DXSql/SQLite.pm b/perl/DXSql/SQLite.pm index 14eb0621..36bcc46d 100644 --- a/perl/DXSql/SQLite.pm +++ b/perl/DXSql/SQLite.pm @@ -36,7 +36,7 @@ sub has_ipaddr my $sth = $self->prepare($s); $sth->execute; while (my @t = $sth->fetchrow_array) { - if ($t[0] eq 'ipaddr') { + if ($t[1] eq 'ipaddr') { $sth->finish; return 1; } @@ -48,7 +48,7 @@ sub has_ipaddr sub add_ipaddr { my $self = shift; - my $s = q(alter table spot add column ipaddr varchar(40)); + my $s = q(alter table spot add column ipaddr text); $self->do($s); } @@ -80,9 +80,13 @@ sub spot_add_indexes { my $self = shift; dbg('adding spot index ix1'); - $self->do('create index spot_ix1 on spot(time desc)'); + $self->do('create index spot_ix1 on spot(time asc)'); dbg('adding spot index ix2'); $self->do('create index spot_ix2 on spot(spotcall asc)'); + dbg('adding spot index ix3'); + $self->do('create index spot_ix3 on spot(freq asc)'); + dbg('adding spot index ix4'); + $self->do('create index spot_ix4 on spot(spotter asc)'); }