-- admin table - Queue for admin tasks sent from front-end for back-end processing.
-- $Id: admin.sql,v 1.6 2007/10/12 05:31:41 maxbaker Exp $ 

DROP TABLE admin;
DROP SEQUENCE admin_job_seq;

CREATE TABLE admin (
    job         serial,
    entered     TIMESTAMP DEFAULT now(),
    started     TIMESTAMP,
    finished    TIMESTAMP,
    device      inet,
    port        text,
    action      text, -- delete, delete+nodes, macsuck, arpnip, refresh, vlan
    subaction   text, -- free field to be used for each action
    status      text, -- queued, running, done, error, del
    username    text,
    userip      inet,
    log         text,
    debug       boolean
                   );

CREATE INDEX idx_admin_entered ON admin(entered);
CREATE INDEX idx_admin_status  ON admin(status);
CREATE INDEX idx_admin_action  ON admin(action);
