-- Sequence: public.absence_reasons_id_seq

-- DROP SEQUENCE public.absence_reasons_id_seq;

CREATE SEQUENCE public.evidence_documents_id_seq
  INCREMENT 1
  MINVALUE 1
  MAXVALUE 9223372036854775807
  START 3
  CACHE 1;
ALTER TABLE public.evidence_documents_id_seq
  OWNER TO postgres;
GRANT ALL ON SEQUENCE public.evidence_documents_id_seq TO postgres;

-- Table: public.evidence_documents

-- DROP TABLE public.evidence_documents;

CREATE TABLE public.evidence_documents
(
  id bigint NOT NULL DEFAULT nextval('evidence_documents_id_seq'::regclass),
  name_document character varying(100) NOT NULL,
  upload_from character varying(100),
  folder character varying(255),
  appointment_code character varying(10) NOT NULL,
  id_user integer NOT NULL,
  current timestamp without time zone,
  file_format character varying(6) NOT NULL,
  description character varying(100),
  CONSTRAINT id_evidence_documents PRIMARY KEY (id),
  CONSTRAINT appointment_code FOREIGN KEY (appointment_code)
      REFERENCES public.appointment (appointment_code) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT id_user FOREIGN KEY (id_user)
      REFERENCES public.user_sonata (id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (
  OIDS=FALSE
);
ALTER TABLE public.evidence_documents
  OWNER TO postgres;
