Skip to content
Snippets Groups Projects
Select Git revision
  • b8b48d855094d967fc9c5ad30952e81d02773fd2
  • master default protected
  • L2SS-1914-fix_job_dispatch
  • TMSS-3170
  • TMSS-3167
  • TMSS-3161
  • TMSS-3158-Front-End-Only-Allow-Changing-Again
  • TMSS-3133
  • TMSS-3319-Fix-Templates
  • test-fix-deploy
  • TMSS-3134
  • TMSS-2872
  • defer-state
  • add-custom-monitoring-points
  • TMSS-3101-Front-End-Only
  • TMSS-984-choices
  • SDC-1400-Front-End-Only
  • TMSS-3079-PII
  • TMSS-2936
  • check-for-max-244-subbands
  • TMSS-2927---Front-End-Only-PXII
  • Before-Remove-TMSS
  • LOFAR-Release-4_4_318 protected
  • LOFAR-Release-4_4_317 protected
  • LOFAR-Release-4_4_316 protected
  • LOFAR-Release-4_4_315 protected
  • LOFAR-Release-4_4_314 protected
  • LOFAR-Release-4_4_313 protected
  • LOFAR-Release-4_4_312 protected
  • LOFAR-Release-4_4_311 protected
  • LOFAR-Release-4_4_310 protected
  • LOFAR-Release-4_4_309 protected
  • LOFAR-Release-4_4_308 protected
  • LOFAR-Release-4_4_307 protected
  • LOFAR-Release-4_4_306 protected
  • LOFAR-Release-4_4_304 protected
  • LOFAR-Release-4_4_303 protected
  • LOFAR-Release-4_4_302 protected
  • LOFAR-Release-4_4_301 protected
  • LOFAR-Release-4_4_300 protected
  • LOFAR-Release-4_4_299 protected
41 results

qpidinfradb.sql

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    qpidinfradb.sql 2.76 KiB
    DROP TABLE IF EXISTS exchanges CASCADE;
    DROP TABLE IF EXISTS queues CASCADE;
    DROP TABLE IF EXISTS hosts CASCADE;
    DROP TABLE IF EXISTS persistentexchanges CASCADE;
    DROP TABLE IF EXISTS persistentqueues CASCADE;
    DROP TABLE IF EXISTS queueroutes CASCADE;
    DROP TABLE IF EXISTS exchangeroutes CASCADE;
    DROP TABLE IF EXISTS queuelistener CASCADE;
    
    CREATE TABLE exchanges(
        exchangeid SERIAL,
        exchangename varchar(512) NOT NULL,
        PRIMARY KEY  (exchangeid)
    );
    CREATE TABLE queues(
        queueid  SERIAL,
        queuename varchar(512) NOT NULL,
        PRIMARY KEY  (queueid)
    );
    CREATE TABLE hosts(
        hostid  SERIAL,
        hostname varchar(512) NOT NULL,
        PRIMARY KEY  (hostid)
    );
    
    CREATE TABLE persistentexchanges (
        pexid SERIAL,
        eid bigint  references exchanges(exchangeid) ON DELETE CASCADE,
        hid bigint  references hosts(hostid) ON DELETE CASCADE,
        PRIMARY KEY  (pexid)
    );
    
    CREATE TABLE persistentqueues (
        pquid SERIAL,
        qid bigint  references queues(queueid) ON DELETE CASCADE,
        hid bigint  references hosts(hostid) ON DELETE CASCADE,
        PRIMARY KEY  (pquid)
    );
    
    CREATE TABLE queueroutes(
        qrouteid SERIAL,
        fromhost bigint  references hosts(hostid) ON DELETE CASCADE,
        tohost bigint  references hosts(hostid) ON DELETE CASCADE,
        qid  bigint  references queues(queueid) ON DELETE CASCADE,
        eid  bigint  references exchanges(exchangeid) ON DELETE CASCADE,
        PRIMARY KEY  (qrouteid)
    );
    CREATE TABLE exchangeroutes(
        erouteid SERIAL,
        fromhost bigint  references hosts(hostid) ON DELETE CASCADE,
        tohost bigint  references hosts(hostid) ON DELETE CASCADE,
        eid bigint references exchanges(exchangeid) ON DELETE CASCADE,
        dynamic bool default false,
        routingkey varchar(512) default '#',
        PRIMARY KEY  (erouteid)
    );
    CREATE TABLE queuelistener(
        qlistenid SERIAL,
        fromhost bigint references hosts(hostid) ON DELETE CASCADE,
        eid bigint  references exchanges(exchangeid) ON DELETE CASCADE,
        qid bigint references queues(queueid) ON DELETE CASCADE,
        subject varchar(512) NOT NULL,
        PRIMARY KEY  (qlistenid)
    );
    
    
    INSERT INTO exchanges (exchangename) VALUES 
        ('lofar.ra.command'),
        ('lofar.ra.notification'),
        ('lofar.otdb.command'),
        ('lofar.otdb.notification'),
        ('lofar.sm.command'),
        ('lofar.sm.notification'),
        ('lofar.mom.command'),
        ('lofar.mom.notification');
    
    INSERT INTO queues (queuename) VALUES 
        ('TreeStatus'),
        ('TaskSpecified'),
        ('ResourceAssigner');
    
    INSERT INTO hosts (hostname) VALUES
        ('scu001.control.lofar'),
        ('ccu001.control.lofar'),
        ('head01.control.lofar');
    
    
    INSERT INTO persistentexchanges (eid,hid) VALUES 
        (1,1),
        (2,1),
        (3,1),
        (4,1),
        (5,1),
        (6,1),
        (7,1),
        (8,1);
    
    insert INTO persistentqueues (qid,hid) VALUES
        (1,1),
        (2,1),
        (3,1);
    
    commit;