File indexing completed on 2025-01-19 05:21:24

0001 /*
0002 Sample grant for PostgreSQL
0003 
0004 CREATE ROLE queue LOGIN
0005   PASSWORD '[CHANGE ME]'
0006   NOSUPERUSER NOINHERIT NOCREATEDB NOCREATEROLE;
0007 
0008 */
0009 
0010 --
0011 -- Table structure for table `queue`
0012 --
0013 
0014 DROP TABLE IF EXISTS queue;
0015 
0016 CREATE TABLE queue
0017 (
0018   queue_id serial NOT NULL,
0019   queue_name character varying(100) NOT NULL,
0020   timeout smallint NOT NULL DEFAULT 30,
0021   CONSTRAINT queue_pk PRIMARY KEY (queue_id)
0022 )
0023 WITH (OIDS=FALSE);
0024 ALTER TABLE queue OWNER TO queue;
0025 
0026 
0027 -- --------------------------------------------------------
0028 --
0029 -- Table structure for table `message`
0030 --
0031 
0032 DROP TABLE IF EXISTS message;
0033 
0034 CREATE TABLE message
0035 (
0036   message_id bigserial NOT NULL,
0037   queue_id integer,
0038   handle character(32),
0039   body character varying(8192) NOT NULL,
0040   md5 character(32) NOT NULL,
0041   timeout double precision,
0042   created integer,
0043   CONSTRAINT message_pk PRIMARY KEY (message_id),
0044   CONSTRAINT message_ibfk_1 FOREIGN KEY (queue_id)
0045       REFERENCES queue (queue_id) MATCH SIMPLE
0046       ON UPDATE CASCADE ON DELETE CASCADE
0047 )
0048 WITH (OIDS=FALSE);
0049 ALTER TABLE message OWNER TO queue;