Changeset 679


Ignore:
Timestamp:
01/19/15 18:09:59 (9 years ago)
Author:
Kris Deugau
Message:

/trunk

  • Add a bit more detail to a couple of docucomments in db-update.pl
  • Drop and recreate the modtime trigger on the allocations table when doing the database update. This preserves the *real* modtimes, instead of generating an entirely artificial one that has nothing to do with changes in the actual IP assignment data.
File:
1 edited

Legend:

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

    r658 r679  
    88use MyIPDB;
    99
    10 # run the tabledef update first
     10# run the tabledef update first.  This is "safe";  IPDB < 3.0 can still happily munch away at it.
    1111print qx { PGPASSWORD=ipdbpwd psql -h localhost -U ipdb ipdb <ipdb-2.7-3.0.sql };
    1212
     
    6060        " WHERE id = ?");
    6161
     62  # Need to disable the update trigger on the allocations table, so we don't mangle the real mtimes on the data.
     63  $dbh->do("DROP TRIGGER up_modtime ON allocations");
     64
    6265  $getm->execute;
    6366  while (my ($master,$mctime,$mmtime,$mswip) = $getm->fetchrow_array()) {
     
    110113    # weesa gotsa BIIIIG job, gotta fetch all the current rDNS.  note this relies
    111114    # on having had the DNS data imported and munged into the new pseudotypes.
     115    # ... never mind.  this will be opportunistic, since DNS data isn't viewed
     116    # unless adding (not present, we should hope!) or updating (where it should
     117    # be retrieved from the authoritative API in real time)
    112118  }
     119
     120  # Recreate modtime trigger on allocations, now that we're done monkeying with it.
     121  $dbh->do("CREATE TRIGGER up_modtime BEFORE UPDATE ON allocations FOR EACH ROW EXECUTE PROCEDURE up_modtime()");
    113122
    114123  $dbh->commit;
Note: See TracChangeset for help on using the changeset viewer.