/*

// Use to reset the table
DROP TABLE public.job;
DROP FUNCTION public.uuid_generate_v1();
DROP SEQUENCE public.job_id_seq;
*/

-- Table: public.job

-- Sequence: public.job_id_seq

-- DROP SEQUENCE public.job_id_seq;

CREATE SEQUENCE public.job_id_seq
  INCREMENT 1
  MINVALUE 1
  MAXVALUE 9223372036854775807
  START 1
  CACHE 1;
ALTER TABLE public.job_id_seq
  OWNER TO melodymanager;

-- Function: public.uuid_generate_v1()

-- DROP FUNCTION public.uuid_generate_v1();

CREATE OR REPLACE FUNCTION public.uuid_generate_v1()
  RETURNS uuid AS
'$libdir/uuid-ossp', 'uuid_generate_v1'
  LANGUAGE c VOLATILE STRICT
  COST 1;
ALTER FUNCTION public.uuid_generate_v1()
  OWNER TO melodymanager;


-- DROP TABLE public.job;

CREATE TABLE public.job
(
  "sTaskCode" character varying(100),
  "sFileName" character varying(1024),
  id integer NOT NULL DEFAULT nextval('job_id_seq'::regclass),
  uuid uuid NOT NULL DEFAULT uuid_generate_v1(),
  "nState" integer DEFAULT 0,
  "dateCreation" timestamp with time zone,
  "dateModification" timestamp with time zone,
  "sGlobalQueueId" character varying(100),
  "sQueueId" character varying(100),
  "nPriority" integer,
  "sMessage" text,
  "sContent" text,
  "sParameters" character varying(4096),
  CONSTRAINT pkey PRIMARY KEY (id)
)
WITH (
  OIDS=FALSE
);
ALTER TABLE public.job
  OWNER TO melodymanager;
