
--
-- Name: dysu_answer_image; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.dysu_answer_image (
    id integer NOT NULL,
    field_id integer NOT NULL,
    register_id integer NOT NULL,
    image_id integer NOT NULL,
    answer_image bytea NOT NULL,
    register_date timestamp without time zone NOT NULL,
    sonata_id integer NOT NULL
);


ALTER TABLE public.dysu_answer_image OWNER TO postgres;

--
-- Name: TABLE dysu_answer_image; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE public.dysu_answer_image IS 'Tabla que contiene la imagen generada al contestar la encuesta';


--
-- Name: COLUMN dysu_answer_image.id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_answer_image.id IS 'Identificador unico de los registros';


--
-- Name: COLUMN dysu_answer_image.field_id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_answer_image.field_id IS 'Identificador del campo relacionado con la respuesta';


--
-- Name: COLUMN dysu_answer_image.register_id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_answer_image.register_id IS 'Identificador relacionado con la informacion diligenciada en la encuesta';


--
-- Name: COLUMN dysu_answer_image.image_id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_answer_image.image_id IS 'Identificador de la imagen de fondo relacionado con el campo de la imagen';


--
-- Name: COLUMN dysu_answer_image.answer_image; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_answer_image.answer_image IS 'Imagen generada con lo dibujado por el usuario';


--
-- Name: COLUMN dysu_answer_image.register_date; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_answer_image.register_date IS 'Fecha en la que se registro la informacion';


--
-- Name: COLUMN dysu_answer_image.sonata_id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_answer_image.sonata_id IS 'Identificador del usuario que realiza el registro';


--
-- Name: dysu_answer_image_aud; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.dysu_answer_image_aud (
    id integer NOT NULL,
    answer_image_id integer NOT NULL,
    field_id integer NOT NULL,
    register_id integer NOT NULL,
    image_id integer NOT NULL,
    answer_image bytea NOT NULL,
    register_date timestamp without time zone NOT NULL,
    edit_date timestamp without time zone NOT NULL,
    sonata_id integer NOT NULL,
    first_sonata_id integer NOT NULL
);


ALTER TABLE public.dysu_answer_image_aud OWNER TO postgres;

--
-- Name: TABLE dysu_answer_image_aud; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE public.dysu_answer_image_aud IS 'Tabla de auditoria que contiene los cambios realizados sobre los registros de la tabla dysu_answer_image';


--
-- Name: COLUMN dysu_answer_image_aud.id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_answer_image_aud.id IS 'Identificador unico de los registros';


--
-- Name: COLUMN dysu_answer_image_aud.answer_image_id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_answer_image_aud.answer_image_id IS 'Identificador del registro modificado';


--
-- Name: COLUMN dysu_answer_image_aud.field_id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_answer_image_aud.field_id IS 'Identificador del campo relacionado con la respuesta';


--
-- Name: COLUMN dysu_answer_image_aud.register_id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_answer_image_aud.register_id IS 'Identificador relacionado con la informacion diligenciada en la encuesta';


--
-- Name: COLUMN dysu_answer_image_aud.image_id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_answer_image_aud.image_id IS 'Identificador de la imagen de fondo relacionado con el campo de la imagen';


--
-- Name: COLUMN dysu_answer_image_aud.answer_image; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_answer_image_aud.answer_image IS 'Imagen generada con lo dibujado por el usuario';


--
-- Name: COLUMN dysu_answer_image_aud.register_date; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_answer_image_aud.register_date IS 'Fecha en la que se registro la informacion';


--
-- Name: COLUMN dysu_answer_image_aud.edit_date; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_answer_image_aud.edit_date IS 'Fecha en la que se modifico el registro';


--
-- Name: COLUMN dysu_answer_image_aud.sonata_id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_answer_image_aud.sonata_id IS 'Identificador del usuario quien realizo la modificacion';


--
-- Name: COLUMN dysu_answer_image_aud.first_sonata_id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_answer_image_aud.first_sonata_id IS 'Identificador del usuario quien realizo la modificacion';


--
-- Name: dysu_answer_image_aud_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.dysu_answer_image_aud_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.dysu_answer_image_aud_id_seq OWNER TO postgres;

--
-- Name: dysu_answer_image_aud_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.dysu_answer_image_aud_id_seq OWNED BY public.dysu_answer_image_aud.id;


--
-- Name: dysu_answer_image_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.dysu_answer_image_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.dysu_answer_image_id_seq OWNER TO postgres;

--
-- Name: dysu_answer_image_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.dysu_answer_image_id_seq OWNED BY public.dysu_answer_image.id;


--
-- Name: dysu_list_color; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.dysu_list_color (
    id integer NOT NULL,
    field_id integer NOT NULL,
    color_code character varying(15) NOT NULL,
    color_state smallint NOT NULL,
    register_date timestamp without time zone NOT NULL,
    sonata_id integer NOT NULL
);


ALTER TABLE public.dysu_list_color OWNER TO postgres;

--
-- Name: TABLE dysu_list_color; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE public.dysu_list_color IS 'Tabla que contiene los colores asignados para dibujar sobre la imagen de la encuesta';


--
-- Name: COLUMN dysu_list_color.id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_color.id IS 'Identificador del registro';


--
-- Name: COLUMN dysu_list_color.field_id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_color.field_id IS 'Identificador del campo';


--
-- Name: COLUMN dysu_list_color.color_code; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_color.color_code IS 'Codigo del color';


--
-- Name: COLUMN dysu_list_color.color_state; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_color.color_state IS 'Estado del registro 1 => Activo 0 => Inactivo';


--
-- Name: COLUMN dysu_list_color.register_date; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_color.register_date IS 'Fecha en la que se realiza el registro';


--
-- Name: COLUMN dysu_list_color.sonata_id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_color.sonata_id IS 'Identificador del usuario que realiza el registro';


--
-- Name: dysu_list_color_aud; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.dysu_list_color_aud (
    id integer NOT NULL,
    color_id integer NOT NULL,
    field_id integer NOT NULL,
    color_code character varying(15) NOT NULL,
    color_state smallint NOT NULL,
    register_date timestamp without time zone NOT NULL,
    edit_date timestamp without time zone NOT NULL,
    sonata_id integer NOT NULL,
    first_sonata_id integer NOT NULL
);


ALTER TABLE public.dysu_list_color_aud OWNER TO postgres;

--
-- Name: TABLE dysu_list_color_aud; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE public.dysu_list_color_aud IS 'Tabla que contiene los registros de auditoria de la tabla dysu_list_color';


--
-- Name: COLUMN dysu_list_color_aud.id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_color_aud.id IS 'Identificador del registro';


--
-- Name: COLUMN dysu_list_color_aud.color_id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_color_aud.color_id IS 'Identificador del color';


--
-- Name: COLUMN dysu_list_color_aud.field_id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_color_aud.field_id IS 'Identificador del campo';


--
-- Name: COLUMN dysu_list_color_aud.color_code; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_color_aud.color_code IS 'Codigo del color ';


--
-- Name: COLUMN dysu_list_color_aud.color_state; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_color_aud.color_state IS 'Estado del registro';


--
-- Name: COLUMN dysu_list_color_aud.register_date; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_color_aud.register_date IS 'Fecha en la que se realiza el registro';


--
-- Name: COLUMN dysu_list_color_aud.edit_date; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_color_aud.edit_date IS 'Fecha en la que se modifica el registro';


--
-- Name: COLUMN dysu_list_color_aud.sonata_id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_color_aud.sonata_id IS 'Usuario que realiza la modificacion del registro';


--
-- Name: COLUMN dysu_list_color_aud.first_sonata_id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_color_aud.first_sonata_id IS 'Usuario que realiza el registro';


--
-- Name: dysu_list_color_aud_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.dysu_list_color_aud_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.dysu_list_color_aud_id_seq OWNER TO postgres;

--
-- Name: dysu_list_color_aud_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.dysu_list_color_aud_id_seq OWNED BY public.dysu_list_color_aud.id;


--
-- Name: dysu_list_color_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.dysu_list_color_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.dysu_list_color_id_seq OWNER TO postgres;

--
-- Name: dysu_list_color_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.dysu_list_color_id_seq OWNED BY public.dysu_list_color.id;


--
-- Name: dysu_list_image; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.dysu_list_image (
    id integer NOT NULL,
    field_id integer NOT NULL,
    image bytea NOT NULL,
    image_state smallint NOT NULL,
    register_date timestamp without time zone NOT NULL,
    sonata_id integer NOT NULL
);


ALTER TABLE public.dysu_list_image OWNER TO postgres;

--
-- Name: TABLE dysu_list_image; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE public.dysu_list_image IS 'Tabla que contiene las imagenes cargadas en la encuesta';


--
-- Name: COLUMN dysu_list_image.id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_image.id IS 'Identificador del registro';


--
-- Name: COLUMN dysu_list_image.field_id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_image.field_id IS 'Identificador del campo que se relaciona con la imagen cargada';


--
-- Name: COLUMN dysu_list_image.image; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_image.image IS 'Imagen cargada para la encuesta';


--
-- Name: COLUMN dysu_list_image.image_state; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_image.image_state IS 'Estado en el que se encuentra el registro  1=> Activo  0=> Inactivo ';


--
-- Name: COLUMN dysu_list_image.register_date; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_image.register_date IS 'Fecha en la que se realiza el registro';


--
-- Name: COLUMN dysu_list_image.sonata_id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_image.sonata_id IS 'Identificador del usuario que realiza el registro';


--
-- Name: dysu_list_image_aud; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.dysu_list_image_aud (
    id integer NOT NULL,
    image_id integer NOT NULL,
    field_id integer NOT NULL,
    image_state smallint NOT NULL,
    register_date timestamp without time zone NOT NULL,
    edit_date timestamp without time zone NOT NULL,
    sonata_id integer NOT NULL,
    first_sonata_id integer NOT NULL
);


ALTER TABLE public.dysu_list_image_aud OWNER TO postgres;

--
-- Name: TABLE dysu_list_image_aud; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE public.dysu_list_image_aud IS 'Tabla que contiene los registros de auditoria de la tabla dysu_list_image';


--
-- Name: COLUMN dysu_list_image_aud.id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_image_aud.id IS 'Identificador del registro';


--
-- Name: COLUMN dysu_list_image_aud.image_id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_image_aud.image_id IS 'Identificador de la imagen';


--
-- Name: COLUMN dysu_list_image_aud.field_id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_image_aud.field_id IS 'Identificador del campo';


--
-- Name: COLUMN dysu_list_image_aud.image_state; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_image_aud.image_state IS 'Estado de la imagen cargada';


--
-- Name: COLUMN dysu_list_image_aud.register_date; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_image_aud.register_date IS 'Fecha en la que se realizo el registro ';


--
-- Name: COLUMN dysu_list_image_aud.edit_date; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_image_aud.edit_date IS 'Fecha en la que se modifica el registro';


--
-- Name: COLUMN dysu_list_image_aud.sonata_id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_image_aud.sonata_id IS 'Identificador del usuario que realiza la modificacion del registro';


--
-- Name: COLUMN dysu_list_image_aud.first_sonata_id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dysu_list_image_aud.first_sonata_id IS 'Identificador del usuario que realiza el registro la primera vez';


--
-- Name: dysu_list_image_aud_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.dysu_list_image_aud_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.dysu_list_image_aud_id_seq OWNER TO postgres;

--
-- Name: dysu_list_image_aud_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.dysu_list_image_aud_id_seq OWNED BY public.dysu_list_image_aud.id;


--
-- Name: dysu_list_image_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.dysu_list_image_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.dysu_list_image_id_seq OWNER TO postgres;

--
-- Name: dysu_list_image_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.dysu_list_image_id_seq OWNED BY public.dysu_list_image.id;


--
-- Name: dysu_answer_image id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dysu_answer_image ALTER COLUMN id SET DEFAULT nextval('public.dysu_answer_image_id_seq'::regclass);


--
-- Name: dysu_answer_image_aud id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dysu_answer_image_aud ALTER COLUMN id SET DEFAULT nextval('public.dysu_answer_image_aud_id_seq'::regclass);


--
-- Name: dysu_list_color id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dysu_list_color ALTER COLUMN id SET DEFAULT nextval('public.dysu_list_color_id_seq'::regclass);


--
-- Name: dysu_list_color_aud id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dysu_list_color_aud ALTER COLUMN id SET DEFAULT nextval('public.dysu_list_color_aud_id_seq'::regclass);


--
-- Name: dysu_list_image id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dysu_list_image ALTER COLUMN id SET DEFAULT nextval('public.dysu_list_image_id_seq'::regclass);


--
-- Name: dysu_list_image_aud id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dysu_list_image_aud ALTER COLUMN id SET DEFAULT nextval('public.dysu_list_image_aud_id_seq'::regclass);


--
-- Name: dysu_answer_image_aud dysu_answer_image_aud_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dysu_answer_image_aud
    ADD CONSTRAINT dysu_answer_image_aud_pkey PRIMARY KEY (id);


--
-- Name: dysu_answer_image dysu_answer_image_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dysu_answer_image
    ADD CONSTRAINT dysu_answer_image_pkey PRIMARY KEY (id);


--
-- Name: dysu_list_color_aud dysu_list_color_aud_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dysu_list_color_aud
    ADD CONSTRAINT dysu_list_color_aud_pkey PRIMARY KEY (id);


--
-- Name: dysu_list_color dysu_list_color_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dysu_list_color
    ADD CONSTRAINT dysu_list_color_pkey PRIMARY KEY (id);


--
-- Name: dysu_list_image_aud dysu_list_image_aud_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dysu_list_image_aud
    ADD CONSTRAINT dysu_list_image_aud_pkey PRIMARY KEY (id);


--
-- Name: dysu_list_image dysu_list_image_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dysu_list_image
    ADD CONSTRAINT dysu_list_image_pkey PRIMARY KEY (id);


--
-- Name: dysu_list_color dysu_field_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dysu_list_color
    ADD CONSTRAINT dysu_field_id FOREIGN KEY (field_id) REFERENCES public.dysu_field(id);


--
-- Name: dysu_list_image dysu_field_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dysu_list_image
    ADD CONSTRAINT dysu_field_id FOREIGN KEY (field_id) REFERENCES public.dysu_field(id);


--
-- Name: dysu_answer_image dysu_field_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dysu_answer_image
    ADD CONSTRAINT dysu_field_id FOREIGN KEY (field_id) REFERENCES public.dysu_field(id);


--
-- Name: dysu_answer_image dysu_register_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dysu_answer_image
    ADD CONSTRAINT dysu_register_id FOREIGN KEY (register_id) REFERENCES public.dysu_register(id);


--
-- Name: dysu_list_color dysu_sonata_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dysu_list_color
    ADD CONSTRAINT dysu_sonata_id FOREIGN KEY (sonata_id) REFERENCES public.user_sonata(id);


--
-- Name: dysu_list_image dysu_sonata_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dysu_list_image
    ADD CONSTRAINT dysu_sonata_id FOREIGN KEY (sonata_id) REFERENCES public.user_sonata(id);


--
-- Name: dysu_answer_image dysu_sonata_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dysu_answer_image
    ADD CONSTRAINT dysu_sonata_id FOREIGN KEY (sonata_id) REFERENCES public.user_sonata(id);

--
-- CREATE INDEXS
--

CREATE INDEX dysu_field_IX1
    ON public.dysu_field USING btree (form_id ASC NULLS LAST) TABLESPACE pg_default;

CREATE INDEX "dysu_field_IX2"
    ON public.dysu_field USING btree (field_type ASC NULLS LAST) TABLESPACE pg_default;

CREATE INDEX "dysu_field_IX3"
    ON public.dysu_field USING btree (state ASC NULLS LAST) TABLESPACE pg_default;

CREATE INDEX "dysu_field_aud_IX1"
    ON public.dysu_field_aud USING btree (field_id ASC NULLS LAST) TABLESPACE pg_default;

CREATE INDEX "dysu_list_color_IX1"
    ON public.dysu_list_color USING btree (field_id ASC NULLS LAST) TABLESPACE pg_default;

CREATE INDEX "dysu_list_color_aud_IX1"
    ON public.dysu_list_color_aud USING btree (color_id ASC NULLS LAST) TABLESPACE pg_default;

CREATE INDEX "dysu_list_color_aud_IX2"
    ON public.dysu_list_color_aud USING btree (field_id ASC NULLS LAST) TABLESPACE pg_default;

CREATE INDEX "dysu_form_aud_IX1"
    ON public.dysu_form_aud USING btree (form_id ASC NULLS LAST) TABLESPACE pg_default;

CREATE INDEX "dysu_list_answers_aud_IX1"
    ON public.dysu_list_answers_aud USING btree (field_id ASC NULLS LAST) TABLESPACE pg_default;

CREATE INDEX "dysu_list_answers_aud_IX2"
    ON public.dysu_list_answers_aud USING btree (list_answers_id ASC NULLS LAST) TABLESPACE pg_default;

CREATE INDEX "dysu_list_image_IX1"
    ON public.dysu_list_image USING btree (field_id ASC NULLS LAST) TABLESPACE pg_default;

CREATE INDEX "dysu_list_image_aud_IX1"
    ON public.dysu_list_image_aud USING btree (field_id ASC NULLS LAST) TABLESPACE pg_default;

CREATE INDEX "dysu_answer_aud_IX1"
    ON public.dysu_answer_aud USING btree (answer_id ASC NULLS LAST) TABLESPACE pg_default;

CREATE INDEX "dysu_answer_aud_IX2"
    ON public.dysu_answer_aud USING btree (register_id ASC NULLS LAST) TABLESPACE pg_default;

CREATE INDEX "dysu_answer_IX1"
    ON public.dysu_answer USING btree (register_id ASC NULLS LAST) TABLESPACE pg_default;

CREATE INDEX "dysu_answer_IX2"
    ON public.dysu_answer USING btree (field_id ASC NULLS LAST) TABLESPACE pg_default;

CREATE INDEX "dysu_answer_IX3"
    ON public.dysu_answer USING btree (field_value ASC NULLS LAST) TABLESPACE pg_default;

CREATE INDEX "dysu_answer_image_aud_IX1"
    ON public.dysu_answer_image_aud USING btree (answer_image_id ASC NULLS LAST) TABLESPACE pg_default;

CREATE INDEX "dysu_register_IX1" 
    ON public.dysu_register USING btree (person_id ASC NULLS LAST, form_id ASC NULLS LAST) TABLESPACE pg_default;

--
-- PostgreSQL database dump complete
--

