Changeset 772 for trunk


Ignore:
Timestamp:
09/01/15 16:39:49 (9 years ago)
Author:
Kris Deugau
Message:

/trunk

Tweak 2.7 -> 3.0 update script to fill in the custid on routed and master blocks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/db-update.pl

    r761 r772  
    2929  # master blocks move to the allocations table
    3030  my $getm = $dbh->prepare("SELECT cidr,ctime,mtime,rwhois FROM masterblocks");
    31   my $insm = $dbh->prepare("INSERT INTO allocations (cidr,type,createstamp,modifystamp,swip) VALUES (?,'mm',?,?,?)");
     31  my $insm = $dbh->prepare("INSERT INTO allocations (cidr,type,createstamp,modifystamp,swip,custid) VALUES (?,'mm',?,?,?,?)");
    3232
    3333  # routed blocks move to the allocations table
    3434  my $getr = $dbh->prepare("SELECT cidr,city FROM routed WHERE cidr <<= ?");
    35   my $insr = $dbh->prepare("INSERT INTO allocations (cidr,type,city,parent_id) VALUES (?,'rm',?,?)");
     35  my $insr = $dbh->prepare("INSERT INTO allocations (cidr,type,city,parent_id,custid) VALUES (?,'rm',?,?,?)");
    3636  my $rfree = $dbh->prepare("UPDATE freeblocks SET parent_id = ?, routed='m' WHERE cidr <<= ? AND routed='y'");
    3737
     
    6868    print "$master\t";
    6969    # copy master to allocations table
    70     $insm->execute($master, $mctime, $mmtime, $mswip);
     70    $insm->execute($master, $mctime, $mmtime, $mswip, $def_custids{'mm'});
    7171    $get_id->execute;
    7272    my ($mid) = $get_id->fetchrow_array();
     
    7979      print "  $routed\t";
    8080      # copy routed to allocations table
    81       $insr->execute($routed, $rcity, $mid);
     81      $insr->execute($routed, $rcity, $mid, $def_custids{'rm'});
    8282      $get_id->execute;
    8383      my ($rid) = $get_id->fetchrow_array();
Note: See TracChangeset for help on using the changeset viewer.