Ignore:
Timestamp:
04/06/05 17:06:28 (19 years ago)
Author:
Kris Deugau
Message:

/trunk

Updated SQL tabledefs with timestamps for master block, routed

block, allocation, and static IP "creation" times; also
allocation and static IP modification times.

Updated db2rwhois.pl with timestamp support and a little code cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/ipdb.psql

    r189 r218  
    7070        "circuitid" character varying(128) DEFAULT '' NOT NULL,
    7171        "newcustid" integer,
     72        "createstamp" timestamp DEFAULT now(),
     73        "modifystamp" timestamp DEFAULT now(),
    7274        CHECK (((available = 'y'::bpchar) OR (available = 'n'::bpchar)))
    7375);
     
    8688        "maskbits" integer DEFAULT 128,
    8789        "circuitid" character varying(128) DEFAULT '',
     90        "createstamp" timestamp DEFAULT now(),
     91        "modifystamp" timestamp DEFAULT now(),
    8892        "newcustid" integer
    8993);
     
    182186pr      Dynamic-route DSL netblock      Dynamic-route DSL       203     
    183187\.
     188
     189--
     190-- Trigger and matching function to update modifystamp on allocations, poolips
     191--
     192CREATE FUNCTION up_modtime () RETURNS OPAQUE AS '
     193    BEGIN
     194        NEW.modifystamp := ''now'';
     195        RETURN NEW;
     196    END;
     197' LANGUAGE 'plpgsql';
     198
     199CREATE TRIGGER up_modtime BEFORE UPDATE ON allocations
     200    FOR EACH ROW EXECUTE PROCEDURE up_modtime();
     201
     202CREATE TRIGGER up_modtime BEFORE UPDATE ON poolips
     203    FOR EACH ROW EXECUTE PROCEDURE up_modtime();
Note: See TracChangeset for help on using the changeset viewer.