 -- PostgreSQL database dump
 --
 
--- Dumped from database version 9.6.7
--- Dumped by pg_dump version 9.6.7
+-- Dumped from database version 9.6.5
+-- Dumped by pg_dump version 9.6.5
 
 SET statement_timeout = 0;
 SET lock_timeout = 0;



--
-- Name: intervention_proposal_parameters; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE intervention_proposal_parameters (
    id integer NOT NULL,
    intervention_proposal_id integer,
    product_id integer,
    product_nature_variant_id integer,
    product_type character varying,
    created_at timestamp without time zone NOT NULL,
    updated_at timestamp without time zone NOT NULL,
    intervention_template_product_parameter_id integer,
    quantity numeric,
    unit character varying
);


--
-- Name: intervention_proposal_parameters_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE intervention_proposal_parameters_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: intervention_proposal_parameters_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE intervention_proposal_parameters_id_seq OWNED BY intervention_proposal_parameters.id;


--
-- Name: intervention_proposals; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE intervention_proposals (
    id integer NOT NULL,
    technical_itinerary_intervention_template_id integer,
    estimated_date date,
    area numeric,
    activity_production_id integer,
    created_at timestamp without time zone NOT NULL,
    updated_at timestamp without time zone NOT NULL,
    number integer,
    target character varying,
    batch_number integer,
    activity_production_irregular_batch_id integer
);


--
-- Name: intervention_proposals_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE intervention_proposals_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: intervention_proposals_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE intervention_proposals_id_seq OWNED BY intervention_proposals.id;


--
-- Name: intervention_template_activities; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE intervention_template_activities (
    id integer NOT NULL,
    intervention_template_id integer,
    activity_id integer,
    created_at timestamp without time zone NOT NULL,
    updated_at timestamp without time zone NOT NULL
);


--
-- Name: intervention_template_activities_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE intervention_template_activities_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: intervention_template_activities_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE intervention_template_activities_id_seq OWNED BY intervention_template_activities.id;


--
-- Name: intervention_template_product_parameters; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE intervention_template_product_parameters (
    id integer NOT NULL,
    intervention_template_id integer,
    product_nature_id integer,
    product_nature_variant_id integer,
    activity_id integer,
    quantity numeric,
    unit character varying,
    type character varying,
    procedure jsonb,
    created_at timestamp without time zone NOT NULL,
    updated_at timestamp without time zone NOT NULL
);


--
-- Name: intervention_template_product_parameters_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE intervention_template_product_parameters_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: intervention_template_product_parameters_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE intervention_template_product_parameters_id_seq OWNED BY intervention_template_product_parameters.id;


--
-- Name: intervention_templates; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE intervention_templates (
    id integer NOT NULL,
    name character varying,
    active boolean DEFAULT true,
    description character varying,
    procedure_name character varying,
    campaign_id integer,
    preparation_time_hours integer,
    preparation_time_minutes integer,
    workflow numeric,
    created_at timestamp without time zone NOT NULL,
    updated_at timestamp without time zone NOT NULL,
    creator_id integer,
    updater_id integer
);


--
-- Name: intervention_templates_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE intervention_templates_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: intervention_templates_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE intervention_templates_id_seq OWNED BY intervention_templates.id;


--
-- Name: intervention_working_periods; Type: TABLE; Schema: public; Owner: -
--




--
-- Name: interventions fk_rails_76eca6ee87; Type: FK CONSTRAINT; Schema: public; Owner: -
--

