-- Sequence: public.out_site_user_id_seq

-- DROP SEQUENCE public.out_site_user_id_seq;

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


-- table: public.docref_appointment

-- DROP TABLE public.docref_appointment;

CREATE TABLE docref_appointment
(
  id bigint NOT NULL DEFAULT nextval('docref_appointment_id_seq'::regclass),
  referring boolean,
  status boolean,
  delivery_type character varying(50),
  current timestamp without time zone NOT NULL,
  id_out_site_user bigint,
  id_room_appointment_study_receipt uuid,
  CONSTRAINT docref_appointment_pkey PRIMARY KEY (id),
  CONSTRAINT "idOutSiteUser" FOREIGN KEY (id_out_site_user)
  REFERENCES out_site_user (id) MATCH SIMPLE
  ON UPDATE CASCADE ON DELETE RESTRICT,
  CONSTRAINT "roomAppointmentStudyReceipt" FOREIGN KEY (id_room_appointment_study_receipt)
  REFERENCES room_appointment_study_receipt (id_room_appointment_study_receipt) MATCH SIMPLE
  ON UPDATE CASCADE ON DELETE RESTRICT
)
WITH (
  OIDS=FALSE
);
ALTER TABLE docref_appointment
  OWNER TO postgres;
COMMENT ON TABLE docref_appointment
  IS 'Tabla para credenciales de médico remitente y a que médicos se envia copia del reporte.';
