



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

CREATE TABLE public.anomalies (
    id bigint NOT NULL,
    created_at timestamp(6) without time zone NOT NULL,
    latitude double precision NOT NULL,
    longitude double precision NOT NULL,
    observation text,
    origin character varying(255) NOT NULL,
    question_id bigint,
    questionnaire_id bigint,
    recommendation text,
    dam_id bigint NOT NULL,
    danger_level_id bigint NOT NULL,
    status_id bigint NOT NULL,
    user_id bigint NOT NULL,
    CONSTRAINT anomalies_origin_check CHECK (((origin)::text = ANY ((ARRAY['CHECKLIST'::character varying, 'WEB'::character varying, 'OTHER'::character varying])::text[])))
);


ALTER TABLE public.anomalies OWNER TO postgres;

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

ALTER TABLE public.anomalies ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.anomalies_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.anomaly_photos (
    id bigint NOT NULL,
    dam_id bigint,
    image_path character varying(255) NOT NULL,
    anomaly_id bigint NOT NULL
);


ALTER TABLE public.anomaly_photos OWNER TO postgres;

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

ALTER TABLE public.anomaly_photos ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.anomaly_photos_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.anomaly_status (
    id bigint NOT NULL,
    description character varying(255),
    name character varying(255) NOT NULL
);


ALTER TABLE public.anomaly_status OWNER TO postgres;

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

ALTER TABLE public.anomaly_status ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.anomaly_status_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.answer_options (
    answer_id bigint NOT NULL,
    option_id bigint NOT NULL
);


ALTER TABLE public.answer_options OWNER TO postgres;

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

CREATE TABLE public.answer_photos (
    id bigint NOT NULL,
    image_path character varying(255) NOT NULL,
    answer_id bigint NOT NULL
);


ALTER TABLE public.answer_photos OWNER TO postgres;

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

ALTER TABLE public.answer_photos ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.answer_photos_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.answers (
    id bigint NOT NULL,
    comment text,
    latitude double precision,
    longitude double precision,
    question_id bigint NOT NULL,
    questionnaire_response_id bigint NOT NULL
);


ALTER TABLE public.answers OWNER TO postgres;

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

ALTER TABLE public.answers ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.answers_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.attributions_permissions (
    id bigint NOT NULL,
    edit_dam boolean NOT NULL,
    edit_geral_data boolean NOT NULL,
    edit_user boolean NOT NULL,
    user_id bigint NOT NULL
);


ALTER TABLE public.attributions_permissions OWNER TO postgres;

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

ALTER TABLE public.attributions_permissions ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.attributions_permissions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.checklist_responses (
    id bigint NOT NULL,
    checklist_id bigint NOT NULL,
    checklist_name character varying(255) NOT NULL,
    created_at timestamp(6) without time zone,
    dam_id bigint NOT NULL,
    user_id bigint NOT NULL
);


ALTER TABLE public.checklist_responses OWNER TO postgres;

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

ALTER TABLE public.checklist_responses ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.checklist_responses_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.checklist_template_questionnaire (
    checklist_id bigint NOT NULL,
    template_questionnaire_id bigint NOT NULL
);


ALTER TABLE public.checklist_template_questionnaire OWNER TO postgres;

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

CREATE TABLE public.checklists (
    id bigint NOT NULL,
    created_at timestamp(6) without time zone,
    name character varying(255) NOT NULL,
    dam_id bigint NOT NULL
);


ALTER TABLE public.checklists OWNER TO postgres;

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

ALTER TABLE public.checklists ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.checklists_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.classification_dams (
    id bigint NOT NULL,
    classification character varying(255) NOT NULL
);


ALTER TABLE public.classification_dams OWNER TO postgres;

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

ALTER TABLE public.classification_dams ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.classification_dams_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.client (
    id bigint NOT NULL,
    city character varying(100) NOT NULL,
    complement character varying(100),
    email character varying(255) NOT NULL,
    email_contact character varying(150),
    logo_path character varying(255),
    name character varying(255) NOT NULL,
    neighborhood character varying(100) NOT NULL,
    number_address character varying(10),
    phone character varying(11) NOT NULL,
    state character varying(100) NOT NULL,
    street character varying(255) NOT NULL,
    whatsapp_phone character varying(11),
    zip_code character varying(9) NOT NULL,
    status_id bigint
);


ALTER TABLE public.client OWNER TO postgres;

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

ALTER TABLE public.client ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.client_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.constant (
    id bigint NOT NULL,
    acronym character varying(255) NOT NULL,
    name character varying(255) NOT NULL,
    "precision" integer NOT NULL,
    value double precision NOT NULL,
    instrument_id bigint NOT NULL,
    measurement_unit_id bigint NOT NULL
);


ALTER TABLE public.constant OWNER TO postgres;

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

ALTER TABLE public.constant ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.constant_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.dam (
    id bigint NOT NULL,
    city character varying(100) NOT NULL,
    dam_image_path character varying(255),
    latitude double precision NOT NULL,
    link_legislation character varying(255),
    linkpsb character varying(255),
    logo_path character varying(255),
    longitude double precision NOT NULL,
    name character varying(255) NOT NULL,
    neighborhood character varying(100),
    number_address character varying(10),
    state character varying(100) NOT NULL,
    street character varying(255) NOT NULL,
    zip_code character varying(9) NOT NULL,
    client_id bigint,
    status_id bigint
);


ALTER TABLE public.dam OWNER TO postgres;

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

ALTER TABLE public.dam ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.dam_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.dam_permissions (
    id bigint NOT NULL,
    created_at timestamp(6) without time zone,
    has_access boolean NOT NULL,
    updated_at timestamp(6) without time zone,
    client_id bigint NOT NULL,
    created_by bigint,
    dam_id bigint NOT NULL,
    updated_by bigint,
    user_id bigint NOT NULL
);


ALTER TABLE public.dam_permissions OWNER TO postgres;

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

ALTER TABLE public.dam_permissions ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.dam_permissions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.danger_levels (
    id bigint NOT NULL,
    description character varying(255),
    name character varying(255) NOT NULL
);


ALTER TABLE public.danger_levels OWNER TO postgres;

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

ALTER TABLE public.danger_levels ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.danger_levels_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.deterministic_limit (
    id bigint NOT NULL,
    alert_value double precision,
    attention_value double precision,
    emergency_value double precision,
    output_id bigint NOT NULL
);


ALTER TABLE public.deterministic_limit OWNER TO postgres;

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

ALTER TABLE public.deterministic_limit ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.deterministic_limit_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.documentation_dam (
    id bigint NOT NULL,
    last_achievement_checklist date,
    last_achievement_isr date,
    last_external_simulation date,
    last_filling_fsb date,
    last_internal_simulation date,
    last_update_pae date,
    last_update_psb date,
    last_update_rpsb date,
    next_achievement_checklist date,
    next_achievement_isr date,
    next_external_simulation date,
    next_filling_fsb date,
    next_internal_simulation date,
    next_update_pae date,
    next_update_psb date,
    next_update_rpsb date,
    dam_id bigint NOT NULL
);


ALTER TABLE public.documentation_dam OWNER TO postgres;

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

ALTER TABLE public.documentation_dam ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.documentation_dam_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.documentation_permissions (
    id bigint NOT NULL,
    edit_psb boolean NOT NULL,
    share_psb boolean NOT NULL,
    view_psb boolean NOT NULL,
    user_id bigint NOT NULL
);


ALTER TABLE public.documentation_permissions OWNER TO postgres;

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

ALTER TABLE public.documentation_permissions ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.documentation_permissions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.input (
    id bigint NOT NULL,
    acronym character varying(255) NOT NULL,
    name character varying(255) NOT NULL,
    "precision" integer NOT NULL,
    instrument_id bigint NOT NULL,
    measurement_unit_id bigint NOT NULL
);


ALTER TABLE public.input OWNER TO postgres;

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

ALTER TABLE public.input ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.input_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.instrument (
    id bigint NOT NULL,
    active boolean NOT NULL,
    active_for_section boolean NOT NULL,
    distance_offset double precision,
    is_linimetric_ruler boolean NOT NULL,
    last_update_variables_date timestamp(6) without time zone NOT NULL,
    latitude double precision NOT NULL,
    linimetric_ruler_code bigint,
    location character varying(255),
    longitude double precision NOT NULL,
    name character varying(255) NOT NULL,
    no_limit boolean NOT NULL,
    dam_id bigint NOT NULL,
    instrument_type_id bigint NOT NULL,
    section_id bigint
);


ALTER TABLE public.instrument OWNER TO postgres;

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

CREATE TABLE public.instrument_graph_axes (
    id bigint NOT NULL,
    abscissa_grid_lines_enable boolean NOT NULL,
    abscissa_px integer NOT NULL,
    primary_ordinate_grid_lines_enable boolean NOT NULL,
    primary_ordinate_initial_value double precision,
    primary_ordinate_maximum_value double precision,
    primary_ordinate_px integer NOT NULL,
    primary_ordinate_spacing double precision,
    primary_ordinate_title character varying(255),
    secondary_ordinate_initial_value double precision,
    secondary_ordinate_maximum_value double precision,
    secondary_ordinate_px integer NOT NULL,
    secondary_ordinate_spacing double precision,
    secondary_ordinate_title character varying(255),
    pattern_id bigint NOT NULL
);


ALTER TABLE public.instrument_graph_axes OWNER TO postgres;

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

ALTER TABLE public.instrument_graph_axes ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.instrument_graph_axes_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.instrument_graph_customization_properties (
    id bigint NOT NULL,
    customization_type character varying(255) NOT NULL,
    fill_color character varying(255),
    is_primary_ordinate boolean NOT NULL,
    label_enable boolean NOT NULL,
    limit_value_type character varying(255),
    line_type character varying(255),
    name character varying(255),
    constant_id bigint,
    deterministic_limit_id bigint,
    instrument_id bigint,
    output_id bigint,
    pattern_id bigint NOT NULL,
    statistical_limit_id bigint,
    CONSTRAINT instrument_graph_customization_propert_customization_type_check CHECK (((customization_type)::text = ANY ((ARRAY['INSTRUMENT'::character varying, 'OUTPUT'::character varying, 'STATISTICAL_LIMIT'::character varying, 'DETERMINISTIC_LIMIT'::character varying, 'LINIMETRIC_RULER'::character varying, 'CONSTANT'::character varying])::text[]))),
    CONSTRAINT instrument_graph_customization_propertie_limit_value_type_check CHECK (((limit_value_type)::text = ANY ((ARRAY['STATISTICAL_LOWER'::character varying, 'STATISTICAL_UPPER'::character varying, 'DETERMINISTIC_ATTENTION'::character varying, 'DETERMINISTIC_ALERT'::character varying, 'DETERMINISTIC_EMERGENCY'::character varying])::text[]))),
    CONSTRAINT instrument_graph_customization_properties_line_type_check CHECK (((line_type)::text = ANY ((ARRAY['SOLID'::character varying, 'DASHED'::character varying, 'DOTTED'::character varying, 'DASH_DOT'::character varying, 'DASH_DOT_DOT'::character varying])::text[])))
);


ALTER TABLE public.instrument_graph_customization_properties OWNER TO postgres;

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

ALTER TABLE public.instrument_graph_customization_properties ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.instrument_graph_customization_properties_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.instrument_graph_pattern (
    id bigint NOT NULL,
    name character varying(255) NOT NULL,
    folder_id bigint,
    instrument_id bigint NOT NULL
);


ALTER TABLE public.instrument_graph_pattern OWNER TO postgres;

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

CREATE TABLE public.instrument_graph_pattern_folder (
    id bigint NOT NULL,
    name character varying(255) NOT NULL,
    dam_id bigint NOT NULL
);


ALTER TABLE public.instrument_graph_pattern_folder OWNER TO postgres;

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

ALTER TABLE public.instrument_graph_pattern_folder ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.instrument_graph_pattern_folder_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

ALTER TABLE public.instrument_graph_pattern ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.instrument_graph_pattern_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

ALTER TABLE public.instrument ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.instrument_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.instrument_tabulate_association (
    id bigint NOT NULL,
    date_index integer,
    hour_index integer,
    is_date_enable boolean,
    is_hour_enable boolean,
    is_read_enable boolean,
    is_user_enable boolean,
    user_index integer,
    instrument_id bigint NOT NULL,
    pattern_id bigint NOT NULL
);


ALTER TABLE public.instrument_tabulate_association OWNER TO postgres;

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

ALTER TABLE public.instrument_tabulate_association ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.instrument_tabulate_association_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.instrument_tabulate_output_association (
    id bigint NOT NULL,
    output_index integer NOT NULL,
    association_id bigint NOT NULL,
    output_id bigint NOT NULL
);


ALTER TABLE public.instrument_tabulate_output_association OWNER TO postgres;

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

ALTER TABLE public.instrument_tabulate_output_association ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.instrument_tabulate_output_association_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.instrument_tabulate_pattern (
    id bigint NOT NULL,
    name character varying(255) NOT NULL,
    dam_id bigint NOT NULL,
    folder_id bigint
);


ALTER TABLE public.instrument_tabulate_pattern OWNER TO postgres;

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

CREATE TABLE public.instrument_tabulate_pattern_folder (
    id bigint NOT NULL,
    name character varying(255) NOT NULL,
    dam_id bigint NOT NULL
);


ALTER TABLE public.instrument_tabulate_pattern_folder OWNER TO postgres;

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

ALTER TABLE public.instrument_tabulate_pattern_folder ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.instrument_tabulate_pattern_folder_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

ALTER TABLE public.instrument_tabulate_pattern ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.instrument_tabulate_pattern_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.instrument_type (
    id bigint NOT NULL,
    name character varying(255) NOT NULL
);


ALTER TABLE public.instrument_type OWNER TO postgres;

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

ALTER TABLE public.instrument_type ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.instrument_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.instrumentation_permissions (
    id bigint NOT NULL,
    edit_graphs_default boolean NOT NULL,
    edit_graphs_local boolean NOT NULL,
    edit_read boolean NOT NULL,
    edit_sections boolean NOT NULL,
    view_graphs boolean NOT NULL,
    view_read boolean NOT NULL,
    view_sections boolean NOT NULL,
    user_id bigint NOT NULL,
    edit_instruments boolean DEFAULT false,
    view_instruments boolean DEFAULT false
);


ALTER TABLE public.instrumentation_permissions OWNER TO postgres;

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

ALTER TABLE public.instrumentation_permissions ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.instrumentation_permissions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.levels (
    id bigint NOT NULL,
    created_at timestamp(6) without time zone,
    name character varying(255) NOT NULL,
    unit_level character varying(255) NOT NULL,
    value double precision NOT NULL
);


ALTER TABLE public.levels OWNER TO postgres;

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

ALTER TABLE public.levels ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.levels_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.measurement_unit (
    id bigint NOT NULL,
    acronym character varying(255) NOT NULL,
    name character varying(255) NOT NULL
);


ALTER TABLE public.measurement_unit OWNER TO postgres;

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

ALTER TABLE public.measurement_unit ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.measurement_unit_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.options (
    id bigint NOT NULL,
    label character varying(255) NOT NULL,
    order_index integer,
    value character varying(255) NOT NULL
);


ALTER TABLE public.options OWNER TO postgres;

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

ALTER TABLE public.options ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.options_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.output (
    id bigint NOT NULL,
    acronym character varying(255) NOT NULL,
    active boolean NOT NULL,
    equation text NOT NULL,
    name character varying(255) NOT NULL,
    "precision" integer NOT NULL,
    instrument_id bigint NOT NULL,
    measurement_unit_id bigint NOT NULL
);


ALTER TABLE public.output OWNER TO postgres;

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

ALTER TABLE public.output ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.output_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.potential_damages (
    id bigint NOT NULL,
    name character varying(255) NOT NULL
);


ALTER TABLE public.potential_damages OWNER TO postgres;

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

ALTER TABLE public.potential_damages ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.potential_damages_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.psb_files (
    id bigint NOT NULL,
    content_type character varying(255),
    download_url character varying(255),
    file_path character varying(255) NOT NULL,
    filename character varying(255) NOT NULL,
    original_filename character varying(255),
    size bigint,
    uploaded_at timestamp(6) without time zone,
    psb_folder_id bigint NOT NULL,
    uploaded_by_id bigint
);


ALTER TABLE public.psb_files OWNER TO postgres;

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

ALTER TABLE public.psb_files ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.psb_files_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.psb_folders (
    id bigint NOT NULL,
    color character varying(255),
    created_at timestamp(6) without time zone,
    description character varying(1000),
    folder_index integer NOT NULL,
    name character varying(255) NOT NULL,
    server_path character varying(255) NOT NULL,
    updated_at timestamp(6) without time zone,
    created_by bigint,
    dam_id bigint NOT NULL,
    parent_folder_id bigint,
    CONSTRAINT psb_folders_color_check CHECK (((color)::text = ANY ((ARRAY['RED'::character varying, 'BLUE'::character varying])::text[])))
);


ALTER TABLE public.psb_folders OWNER TO postgres;

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

ALTER TABLE public.psb_folders ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.psb_folders_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.question_option (
    question_id bigint NOT NULL,
    option_id bigint NOT NULL
);


ALTER TABLE public.question_option OWNER TO postgres;

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

CREATE TABLE public.questionnaire_responses (
    id bigint NOT NULL,
    created_at timestamp(6) without time zone NOT NULL,
    checklist_response_id bigint NOT NULL,
    dam_id bigint NOT NULL,
    template_questionnaire_id bigint NOT NULL
);


ALTER TABLE public.questionnaire_responses OWNER TO postgres;

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

ALTER TABLE public.questionnaire_responses ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.questionnaire_responses_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.questions (
    id bigint NOT NULL,
    question_text character varying(255) NOT NULL,
    type character varying(255) NOT NULL,
    CONSTRAINT questions_type_check CHECK (((type)::text = ANY ((ARRAY['CHECKBOX'::character varying, 'TEXT'::character varying])::text[])))
);


ALTER TABLE public.questions OWNER TO postgres;

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

ALTER TABLE public.questions ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.questions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.reading (
    id bigint NOT NULL,
    active boolean NOT NULL,
    calculated_value double precision NOT NULL,
    comment text,
    date date NOT NULL,
    hour time(6) without time zone NOT NULL,
    limit_status character varying(255) NOT NULL,
    instrument_id bigint NOT NULL,
    output_id bigint NOT NULL,
    user_id bigint,
    CONSTRAINT reading_limit_status_check CHECK (((limit_status)::text = ANY ((ARRAY['NORMAL'::character varying, 'INFERIOR'::character varying, 'SUPERIOR'::character varying, 'ATENCAO'::character varying, 'ALERTA'::character varying, 'EMERGENCIA'::character varying])::text[])))
);


ALTER TABLE public.reading OWNER TO postgres;

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

ALTER TABLE public.reading ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.reading_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.reading_input_value (
    id bigint NOT NULL,
    input_acronym character varying(255) NOT NULL,
    input_name character varying(255) NOT NULL,
    value double precision NOT NULL,
    reading_id bigint NOT NULL
);


ALTER TABLE public.reading_input_value OWNER TO postgres;

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

ALTER TABLE public.reading_input_value ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.reading_input_value_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.regulatory_dam (
    id bigint NOT NULL,
    frame_pnsb boolean NOT NULL,
    representative_email character varying(255),
    representative_name character varying(255),
    representative_phone character varying(255),
    supervisory_body_name character varying(255),
    technical_manager_email character varying(255),
    technical_manager_name character varying(255),
    technical_manager_phone character varying(255),
    classification_dam_id bigint,
    dam_id bigint NOT NULL,
    potential_damage_id bigint,
    risk_category_id bigint,
    security_level_id bigint
);


ALTER TABLE public.regulatory_dam OWNER TO postgres;

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

ALTER TABLE public.regulatory_dam ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.regulatory_dam_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.reservoirs (
    id bigint NOT NULL,
    created_at timestamp(6) without time zone,
    dam_id bigint NOT NULL,
    level_id bigint NOT NULL
);


ALTER TABLE public.reservoirs OWNER TO postgres;

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

ALTER TABLE public.reservoirs ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.reservoirs_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.risk_categories (
    id bigint NOT NULL,
    name character varying(255) NOT NULL
);


ALTER TABLE public.risk_categories OWNER TO postgres;

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

ALTER TABLE public.risk_categories ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.risk_categories_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.roles (
    id bigint NOT NULL,
    description character varying(255) NOT NULL,
    name character varying(255) NOT NULL,
    CONSTRAINT roles_name_check CHECK (((name)::text = ANY ((ARRAY['ADMIN'::character varying, 'COLLABORATOR'::character varying])::text[])))
);


ALTER TABLE public.roles OWNER TO postgres;

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

ALTER TABLE public.roles ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.roles_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.routine_inspection_permissions (
    id bigint NOT NULL,
    is_fill_mobile boolean NOT NULL,
    is_fill_web boolean NOT NULL,
    user_id bigint NOT NULL
);


ALTER TABLE public.routine_inspection_permissions OWNER TO postgres;

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

ALTER TABLE public.routine_inspection_permissions ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.routine_inspection_permissions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.section (
    id bigint NOT NULL,
    file_path character varying(255),
    first_vertex_latitude double precision NOT NULL,
    first_vertex_longitude double precision NOT NULL,
    name character varying(255) NOT NULL,
    second_vertex_latitude double precision NOT NULL,
    second_vertex_longitude double precision NOT NULL,
    dam_id bigint
);


ALTER TABLE public.section OWNER TO postgres;

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

ALTER TABLE public.section ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.section_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.security_levels (
    id bigint NOT NULL,
    level character varying(255) NOT NULL
);


ALTER TABLE public.security_levels OWNER TO postgres;

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

ALTER TABLE public.security_levels ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.security_levels_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.sex (
    id bigint NOT NULL,
    name character varying(255) NOT NULL
);


ALTER TABLE public.sex OWNER TO postgres;

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

ALTER TABLE public.sex ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.sex_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.statistical_limit (
    id bigint NOT NULL,
    lower_value double precision,
    upper_value double precision,
    output_id bigint NOT NULL
);


ALTER TABLE public.statistical_limit OWNER TO postgres;

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

ALTER TABLE public.statistical_limit ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.statistical_limit_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.status (
    id bigint NOT NULL,
    status character varying(255) NOT NULL,
    CONSTRAINT status_status_check CHECK (((status)::text = ANY ((ARRAY['ACTIVE'::character varying, 'DISABLED'::character varying])::text[])))
);


ALTER TABLE public.status OWNER TO postgres;

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

ALTER TABLE public.status ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.status_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.template_questionnaire_questions (
    id bigint NOT NULL,
    order_index integer NOT NULL,
    question_id bigint NOT NULL,
    template_questionnaire_id bigint NOT NULL
);


ALTER TABLE public.template_questionnaire_questions OWNER TO postgres;

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

ALTER TABLE public.template_questionnaire_questions ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.template_questionnaire_questions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.template_questionnaires (
    id bigint NOT NULL,
    name character varying(255) NOT NULL
);


ALTER TABLE public.template_questionnaires OWNER TO postgres;

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

ALTER TABLE public.template_questionnaires ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.template_questionnaires_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


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

CREATE TABLE public.user_client (
    user_id bigint NOT NULL,
    client_id bigint NOT NULL
);


ALTER TABLE public.user_client OWNER TO postgres;


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

CREATE TABLE public.verification_codes (
    id bigint NOT NULL,
    code character varying(255) NOT NULL,
    expiry_date timestamp(6) without time zone NOT NULL,
    used boolean NOT NULL,
    user_id bigint NOT NULL
);


ALTER TABLE public.verification_codes OWNER TO postgres;

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

ALTER TABLE public.verification_codes ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.verification_codes_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


--
-- Data for Name: anomalies; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.anomalies (id, created_at, latitude, longitude, observation, origin, question_id, questionnaire_id, recommendation, dam_id, danger_level_id, status_id, user_id) FROM stdin;
1	2025-12-08 22:25:00.266401	-20.38177	-51.364255	teste	WEB	\N	\N	teste	1	1	1	1
2	2025-12-08 22:25:14.65673	-20.38177	-51.364255	sdf	WEB	\N	\N	sdf	1	1	1	1
3	2025-12-08 23:09:54.436672	-20.790622	-51.626987	Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,	CHECKLIST	\N	\N	and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).	3	1	3	1
4	2025-12-08 23:11:57.00684	-20.790622	-51.626987	Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,	CHECKLIST	\N	\N	and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).	3	1	3	1
5	2025-12-10 11:12:40.29986	-20.38177	-51.364255	teste	WEB	\N	\N	teste	1	1	1	1
6	2025-12-10 11:13:09.108775	-20.38177	-51.364255	teste	WEB	\N	\N	teste	1	1	1	1
7	2025-12-18 17:31:57.808898	-20.790622	-51.626987	res	WEB	1	\N	tes	3	2	1	2
\.


--
-- Data for Name: anomaly_photos; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.anomaly_photos (id, dam_id, image_path, anomaly_id) FROM stdin;
1	1	https://geometrisa-prod.com.br/storage/anomalies/1765243500_Captura_de_Tela_2025-12-08_a_s_22.09.35.png	1
2	1	https://geometrisa-prod.com.br/storage/anomalies/1765243514_Captura_de_Tela_2025-12-08_a_s_22.09.35.png	2
3	3	https://geometrisa-prod.com.br/storage/anomalies/1765246194_Captura_de_Tela_2025-12-08_a_s_23.08.46.png	3
4	1	https://geometrisa-prod.com.br/storage/anomalies/1765375960_amasa_logo.png	5
5	3	https://geometrisa-prod.com.br/storage/anomalies/1766089917_IMG_6085.jpg	7
\.


--
-- Data for Name: anomaly_status; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.anomaly_status (id, description, name) FROM stdin;
1	Anomalia pendente	Pendente
2	Anomalia em andamento	Em andamento
3	Anomalia concluída	Concluído
4	Anomalia em monitoramento	Em monitoramento
5	Ainda não foi definido um status para a anomalia	--
\.


--
-- Data for Name: answer_options; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.answer_options (answer_id, option_id) FROM stdin;
\.


--
-- Data for Name: answer_photos; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.answer_photos (id, image_path, answer_id) FROM stdin;
\.


--
-- Data for Name: answers; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.answers (id, comment, latitude, longitude, question_id, questionnaire_response_id) FROM stdin;
\.


--
-- Data for Name: attributions_permissions; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.attributions_permissions (id, edit_dam, edit_geral_data, edit_user, user_id) FROM stdin;
9	f	f	f	7
11	f	f	f	8
14	f	f	f	4
15	t	f	t	10
16	f	f	f	11
17	f	f	f	13
18	f	f	f	14
20	f	f	f	16
21	t	f	f	18
22	f	f	f	19
10	f	t	t	3
23	f	f	f	20
19	t	f	t	15
\.


--
-- Data for Name: checklist_responses; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.checklist_responses (id, checklist_id, checklist_name, created_at, dam_id, user_id) FROM stdin;
\.


--
-- Data for Name: checklist_template_questionnaire; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.checklist_template_questionnaire (checklist_id, template_questionnaire_id) FROM stdin;
1	4
2	4
3	4
\.


--
-- Data for Name: checklists; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.checklists (id, created_at, name, dam_id) FROM stdin;
1	2025-12-21 15:45:10.071749	Checklist 01	4
2	2025-12-22 09:52:53.265492	Checklist 01	3
3	2025-12-22 15:14:16.356343	TESTEEEE	2
\.


--
-- Data for Name: classification_dams; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.classification_dams (id, classification) FROM stdin;
1	A
2	B
3	C
4	D
5	E
\.


--
-- Data for Name: client; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.client (id, city, complement, email, email_contact, logo_path, name, neighborhood, number_address, phone, state, street, whatsapp_phone, zip_code, status_id) FROM stdin;
12	ILHA SOLTEIRA	CASA	sacoplast@email.com		\N	SACOPLAST	NORTE	SN	18981871485	São Paulo	RUA DAS BANDEIRAS	18981871485	15385-000	1
8	ILHA SOLTEIRA	X	segbar@segbar.com.br		https://geometrisa-prod.com.br/storage/client-logos/1763490077_client_logo_1763490077738.png	SEGBAR	NORTE	1254D	18981871485	São Paulo	AV X	18981871485	15385-126	1
9	Paranaiba	Casa	gabrielpereira@somosdevteam.com		https://geometrisa-prod.com.br/storage/client-logos/1764934619_client_logo_1764934619168.jpg	Somos Devs	Centro	1500	67981957833	Mato Grosso do Sul	Rua Joao rosa de souza	67981957833	79500-000	1
7	ILHA SOLTEIRA	SALA 4	geo@email.com.br		https://geometrisa-prod.com.br/storage/client-logos/1761315386_client_logo_1761315386221.png	GEOMETRISA	CENTRO	100A	18981871485	São Paulo	SHOPPING SUL	18918187148	15385-000	1
10	São José do Rio Preto	Casa	ceogpag@gmail.com		https://geometrisa-prod.com.br/storage/client-logos/1765715653_client_logo_1765715653591.jpg	CEOPAG	Rendentora	3112	00000000000	São Paulo	Rua Jaci	00000000000	79500-000	1
1	ILHA SOLTEIRA	CASA	ctg@email.com.br		https://geometrisa-prod.com.br/storage/client-logos/1761237814_client_logo_1761237814837.png	CTG BRASIL	PERIMETRAL	SN	18981871485	São Paulo	AVENIDA PERIMETRAL 	18981871485	15385-126	1
11	BELO HORIZONTE	CASA	email@teste.com		https://geometrisa-prod.com.br/storage/client-logos/1765716416_client_logo_1765716416842.jpg	youtube	TESTE	1500	12312312313	Acre	TESTE	12313123123	13123-123	2
18	paranaiba	casa	cleinte@teste.com		https://geometrisa-prod.com.br/storage/client-logos/1766406183_client_logo_1766406183988.jpg	client teste	centro phone	1500	12312231231	Alagoas	rua teste	12312312312	12121-212	1
\.


--
-- Data for Name: constant; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.constant (id, acronym, name, "precision", value, instrument_id, measurement_unit_id) FROM stdin;
1	CT	CONSTANTE	6	2	1	12
2	CTS	constante	6	12	2	12
6	CT	CONSTANTE	6	1	7	1
5	CT	CONSTANTE	6	1	5	1
7	CT	CONSTANTE	6	2	8	1
4	CT	CONSTANTE	6	5	4	1
3	CT	CONSTANTE	6	2	3	1
8	CT	CONSTANTE	6	2	25	1
9	CT	CONSTANTE	6	5	26	1
10	CT	CONSTANTE	6	1	27	1
11	CT	CONSTANTE	6	2	29	12
12	CT	CONSTANTE	6	2	30	12
13	CT	CONSTANTE	6	2	31	1
14	CT	CONSTANTE	6	5	32	1
15	CT	CONSTANTE	6	1	33	1
16	CTS	CONSTANTES	6	22	37	6
17	CT	CONSTANTE	6	5	39	1
18	CT	CONSTANTE	6	1	40	1
\.


--
-- Data for Name: dam; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.dam (id, city, dam_image_path, latitude, link_legislation, linkpsb, logo_path, longitude, name, neighborhood, number_address, state, street, zip_code, client_id, status_id) FROM stdin;
4	Ilha Solteira	https://geometrisa-prod.com.br/storage/dam_images/1763490562_dam_image.jpg	-20.436148	https://www.globo.com	https://www.globo.com	https://geometrisa-prod.com.br/storage/logos/1763490562_logo.jpg	-51.340805	UHE SARANDI	Zona Norte	100	São Paulo	AV RUA	15388-146	8	1
5	Paranaíba	https://geometrisa-prod.com.br/storage/dam_images/1764934954_dam_image.jpg	-20.789619			https://geometrisa-prod.com.br/storage/logos/1764934953_logo.jpg	-51.630292	UHE SJRP	centro	30	Mato Grosso do Sul	rua joao rosa de souza	79500-000	9	1
3	Ilha Solteira	\N	-20.790622			\N	-51.626987	UHE DE TRÊS IRMÃOS	Zona Norte	100	São Paulo	RODOVIA MARECHAL RONDON	15385-126	7	1
7	Ilha Solteira	https://geometrisa-prod.com.br/storage/dam_images/1765542148_dam_image.jpg	-7.167493			https://geometrisa-prod.com.br/storage/logos/1765542148_logo.jpg	-62.882996	UHE PEDRO	BAIRRO Y	6484	São Paulo	RUA X	15388-146	7	1
1	Ilha Solteira	\N	-20.38177	https://www.ctgbr.com.br/	https://www.ctgbr.com.br/	\N	-51.364255	UHE DE ILHA SOLTEIRA	ZONA RURAL	212	São Paulo	RODOVIA FELICIANO SALLES DA CUNHA	15385-126	1	1
6	Ilha Solteira	\N	-10.077037			\N	-48.375549	UHE PALMAS TOCANTINS	NORTE	206	São Paulo	PASSEIO GOIANIA	15385-126	1	1
2	Ilha Solteira	\N	-20.669946	https://github.com/drestremot	https://github.com/drestremot	\N	-51.299237	UHE DE JUPIÁ			São Paulo	JUPIÁ	15385-126	1	1
\.


--
-- Data for Name: dam_permissions; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.dam_permissions (id, created_at, has_access, updated_at, client_id, created_by, dam_id, updated_by, user_id) FROM stdin;
38	2025-12-12 09:33:47.826944	f	\N	7	\N	3	\N	16
39	2025-12-12 09:33:47.83316	f	\N	7	\N	7	\N	16
40	2025-12-12 10:21:25.687218	f	2025-12-12 11:50:20.452955	7	\N	3	\N	15
47	2025-12-13 09:44:04.956485	f	\N	1	\N	6	\N	3
49	2025-12-15 01:41:40.054755	f	\N	7	\N	7	\N	18
46	2025-12-13 09:44:04.950867	t	2025-12-16 09:55:20.827007	1	\N	2	\N	3
48	2025-12-15 01:41:40.032827	t	2025-12-16 12:47:58.785559	7	\N	3	\N	18
24	2025-11-18 11:16:16.370714	t	2025-12-16 16:36:21.455617	7	\N	3	\N	7
45	2025-12-13 09:44:04.929746	t	2025-12-18 11:04:43.118529	1	\N	1	\N	3
50	2025-12-18 11:05:19.100085	f	\N	1	\N	1	\N	20
51	2025-12-18 11:05:19.117148	f	\N	1	\N	6	\N	20
52	2025-12-18 11:05:19.121394	f	\N	1	\N	2	\N	20
21	2025-11-18 11:15:29.750251	f	\N	1	\N	2	\N	4
41	2025-12-12 10:21:25.697997	t	2025-12-22 09:17:54.906324	7	\N	7	\N	15
26	2025-11-18 15:11:29.986013	f	\N	1	\N	1	\N	4
27	2025-12-05 08:43:30.969458	t	2025-12-05 08:44:12.927792	9	\N	5	\N	10
31	2025-12-11 15:59:09.737266	f	\N	1	\N	1	\N	8
32	2025-12-11 15:59:09.789926	f	\N	1	\N	2	\N	8
33	2025-12-11 15:59:09.795022	f	\N	1	\N	6	\N	8
34	2025-12-11 15:59:09.81992	f	\N	1	\N	1	\N	11
35	2025-12-11 15:59:09.824033	f	\N	1	\N	2	\N	11
36	2025-12-11 15:59:09.828016	f	\N	1	\N	6	\N	11
\.


--
-- Data for Name: danger_levels; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.danger_levels (id, description, name) FROM stdin;
1	Nível de perigo normal	Normal
2	Nível de perigo atenção	Atenção
3	Nível de perigo alerta	Alerta
4	Nível de perigo emergência	Emergência
5	Ainda não foi definido um nível de perigo	--
\.


--
-- Data for Name: deterministic_limit; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.deterministic_limit (id, alert_value, attention_value, emergency_value, output_id) FROM stdin;
1	\N	\N	\N	10
2	\N	\N	\N	11
3	\N	\N	\N	14
5	\N	\N	\N	16
6	\N	\N	\N	17
7	\N	\N	\N	24
\.


--
-- Data for Name: documentation_dam; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.documentation_dam (id, last_achievement_checklist, last_achievement_isr, last_external_simulation, last_filling_fsb, last_internal_simulation, last_update_pae, last_update_psb, last_update_rpsb, next_achievement_checklist, next_achievement_isr, next_external_simulation, next_filling_fsb, next_internal_simulation, next_update_pae, next_update_psb, next_update_rpsb, dam_id) FROM stdin;
2	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	2
1	\N	\N	\N	\N	\N	2025-10-26	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	1
3	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	3
4	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	4
5	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	5
6	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	6
7	\N	2025-12-16	\N	\N	\N	2025-12-16	\N	\N	2025-12-09	\N	\N	\N	\N	\N	2025-12-17	\N	7
\.


--
-- Data for Name: documentation_permissions; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.documentation_permissions (id, edit_psb, share_psb, view_psb, user_id) FROM stdin;
9	f	f	f	7
11	f	f	f	8
14	f	f	f	4
15	t	t	t	10
16	f	f	f	11
10	f	t	t	3
17	f	f	f	13
18	f	f	f	14
20	f	f	f	16
19	f	f	f	15
21	f	f	f	18
22	f	f	f	19
23	f	f	f	20
\.


--
-- Data for Name: input; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.input (id, acronym, name, "precision", instrument_id, measurement_unit_id) FROM stdin;
1	LEI	LEITURA	6	1	12
2	ENT	Entrada de agua	6	2	2
3	LEI	LEITURA	6	3	1
4	LEI	LEITURA	6	4	1
5	LEI	LEITURA	6	5	1
6	LEI	Leitura	6	6	1
7	LEI	LEITURA	6	7	1
8	LEI	LEITURA	6	8	1
9	LEI	Leitura	6	9	1
10	LEI	LEITURA	6	25	1
11	LEI	LEITURA	6	26	1
12	LEI	LEITURA	6	27	1
13	LEI	Leitura	6	28	1
14	LEI	LEITURA	6	29	12
16	LEI	LEITURA	6	31	1
17	LEI	LEITURA	6	32	1
18	LEI	LEITURA	6	33	1
19	LEI	Leitura	6	34	1
20	LEI	Leitura	6	35	1
21	LEI	Leitura	6	36	1
22	LEI	LEITURA	6	37	4
23	VA	VAZAO	6	37	3
24	LEI	Leitura	6	38	1
15	LEI	LEITURAw	6	30	12
25	LEI	LEITURA	6	39	1
26	LEI	LEITURA	6	40	1
27	LEI	Leitura	6	41	1
\.


--
-- Data for Name: instrument; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.instrument (id, active, active_for_section, distance_offset, is_linimetric_ruler, last_update_variables_date, latitude, linimetric_ruler_code, location, longitude, name, no_limit, dam_id, instrument_type_id, section_id) FROM stdin;
6	t	f	23	t	2025-11-03 15:38:58.705959	-20.818166	2312311	dfsfsd	-49.385852	RASDASD	t	1	1	\N
7	t	t	1	f	2025-11-04 14:40:37.698682	-20.425559	\N	Ombreira Direita	-51.34329	PZ-01	t	1	1	\N
9	t	f	1	t	2025-11-04 15:18:25.03784	-20.434125	10101010	Ombreira Direita	-51.337626	REGUA	t	2	2	\N
5	t	t	3.22	f	2025-11-05 10:55:09.450373	-22.276624	\N	OMBREIRA DIREITA	-49.074135	PZ-013	t	2	1	\N
4	t	t	2.33	f	2025-11-07 19:34:48.337113	-22.276624	\N	OMBREIRA DIREITA	-49.074135	PZ-012	f	2	1	\N
3	t	t	2.33	f	2025-11-11 06:35:23.171808	-20.276506	\N	Ombreira Direita	-50.54139	PZ-01	f	2	1	\N
25	t	t	2.33	f	2025-11-18 07:31:25.992874	-20.276506	\N	Ombreira Direita	-50.54139	PZ-01	f	3	1	\N
26	t	t	2.33	f	2025-11-18 07:31:26.131655	-22.276624	\N	OMBREIRA DIREITA	-49.074135	PZ-012	f	3	1	\N
27	t	t	3.22	f	2025-11-18 07:31:26.210177	-22.276624	\N	OMBREIRA DIREITA	-49.074135	PZ-013	t	3	1	\N
28	t	t	1	f	2025-11-18 07:31:26.332096	-20.434125	\N	Ombreira Direita	-51.337626	REGUA	t	3	2	\N
29	t	t	1.22	f	2025-11-18 13:23:52.09077	-23.675079	\N	Ombreira Direita	-46.670534	PZ-01-OLD	f	2	1	\N
8	t	f	2.14	f	2025-11-07 11:59:39.391147	-20.425553	\N	Margem Direita	-51.343291	EXEMPLO	f	1	1	\N
31	t	t	2.33	f	2025-11-19 09:15:50.624142	-20.276506	\N	Ombreira Direita	-50.54139	PZ-01	f	4	1	\N
32	t	t	2.33	f	2025-11-19 09:15:50.780915	-22.276624	\N	OMBREIRA DIREITA	-49.074135	PZ-012	f	4	1	\N
33	t	t	3.22	f	2025-11-19 09:15:50.830447	-22.276624	\N	OMBREIRA DIREITA	-49.074135	PZ-013	t	4	1	\N
34	t	t	1	f	2025-11-19 09:15:50.93951	-20.434125	\N	Ombreira Direita	-51.337626	REGUA	t	4	2	\N
1	t	f	1.22	f	2025-10-23 13:53:30.784646	-23.675079	\N	Ombreira Direita	-46.670534	PZ-01-OLD	f	1	1	\N
35	t	f	0	t	2025-11-26 10:35:59.88761	-20.2142	21780240	Montante	-47.7064	CGH BURITIS MONTANTE	t	2	2	\N
36	t	f	0	t	2025-11-26 10:49:47.420924	-20.208026	62742000	ESTACAOJAU	-50.931302	JAÚ	t	2	2	\N
2	t	t	12	f	2025-12-04 23:58:12.286953	-20.817983	\N	teste loc	-49.385791	PZ-02	t	1	1	\N
37	t	f	14	f	2025-12-05 08:48:01.827577	-20.818362	\N	OMBREIRA SUL	-49.385782	PZ-32	t	5	1	\N
38	t	t	12	t	2025-12-05 08:52:15.3674	-20.81807	79500000	OMBREIRA CENTRAL	-49.386019	REGUA JUSANTE	t	5	2	\N
30	t	t	21	f	2025-12-11 16:52:31.107373	-23.675079	\N	Ombreira Direita	-46.670534	PZ-01-OLDS	t	4	1	\N
39	t	t	2.33	f	2025-12-11 19:45:37.862755	-22.276624	\N	OMBREIRA DIREITA	-49.074135	PZ-012	f	1	1	\N
40	t	t	3.22	f	2025-12-11 19:45:38.048663	-22.276624	\N	OMBREIRA DIREITA	-49.074135	PZ-013	t	1	1	\N
41	t	t	1	f	2025-12-11 19:45:38.133592	-20.434125	\N	Ombreira Direita	-51.337626	REGUA	t	1	2	\N
\.


--
-- Data for Name: instrument_graph_axes; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.instrument_graph_axes (id, abscissa_grid_lines_enable, abscissa_px, primary_ordinate_grid_lines_enable, primary_ordinate_initial_value, primary_ordinate_maximum_value, primary_ordinate_px, primary_ordinate_spacing, primary_ordinate_title, secondary_ordinate_initial_value, secondary_ordinate_maximum_value, secondary_ordinate_px, secondary_ordinate_spacing, secondary_ordinate_title, pattern_id) FROM stdin;
1	t	14	t	\N	\N	14	\N	\N	\N	\N	14	\N	\N	1
4	t	14	t	\N	\N	14	\N	\N	\N	\N	14	\N	\N	4
5	t	14	t	\N	\N	14	\N	\N	\N	\N	14	\N	\N	5
6	t	14	t	\N	\N	14	\N	\N	\N	\N	14	\N	\N	6
7	t	14	t	\N	\N	14	\N	\N	\N	\N	14	\N	\N	7
9	t	14	t	\N	\N	14	\N	\N	\N	\N	14	\N	\N	9
10	t	14	t	\N	\N	14	\N	\N	\N	\N	14	\N	\N	10
11	t	14	t	\N	\N	14	\N	\N	\N	\N	14	\N	\N	11
12	t	14	t	\N	\N	14	\N	\N	\N	\N	14	\N	\N	12
13	t	14	t	\N	\N	14	\N	\N	\N	\N	14	\N	\N	13
14	t	14	t	\N	\N	14	\N	\N	\N	\N	14	\N	\N	14
15	t	14	t	\N	\N	14	\N	\N	\N	\N	14	\N	\N	15
16	t	14	t	\N	\N	14	\N	\N	\N	\N	14	\N	\N	16
17	t	14	t	\N	\N	14	\N	\N	\N	\N	14	\N	\N	17
18	t	14	t	\N	\N	14	\N	\N	\N	\N	14	\N	\N	18
19	t	14	t	\N	\N	14	\N	\N	\N	\N	14	\N	\N	19
20	t	14	t	\N	\N	14	\N	\N	\N	\N	14	\N	\N	20
21	t	14	t	\N	\N	14	\N	\N	\N	\N	14	\N	\N	21
23	t	14	t	\N	\N	14	\N	\N	\N	\N	14	\N	\N	23
24	t	14	t	\N	\N	14	\N	Temperatura	\N	\N	14	\N	Data	24
2	t	14	t	\N	\N	14	\N	Temperatura (ºC)	\N	\N	14	\N	\N	2
3	t	14	t	\N	\N	14	\N	Vazão m³/s	\N	\N	14	\N	\N	3
25	t	14	t	\N	\N	14	\N	\N	\N	\N	14	\N	\N	25
26	t	14	t	\N	\N	14	\N	\N	\N	\N	14	\N	\N	26
22	t	14	t	\N	\N	14	\N	Nível (m)	\N	\N	14	\N	Régua	22
27	t	14	t	\N	\N	14	\N	\N	\N	\N	14	\N	\N	27
28	t	14	t	\N	\N	14	\N	\N	\N	\N	14	\N	\N	28
29	t	14	t	\N	\N	14	\N	\N	\N	\N	14	\N	\N	29
\.


--
-- Data for Name: instrument_graph_customization_properties; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.instrument_graph_customization_properties (id, customization_type, fill_color, is_primary_ordinate, label_enable, limit_value_type, line_type, name, constant_id, deterministic_limit_id, instrument_id, output_id, pattern_id, statistical_limit_id) FROM stdin;
3	STATISTICAL_LIMIT	#00AA00	t	t	STATISTICAL_LOWER	DASHED	\N	\N	\N	\N	\N	1	1
4	STATISTICAL_LIMIT	#AA0000	t	t	STATISTICAL_UPPER	DASHED	\N	\N	\N	\N	\N	1	1
5	INSTRUMENT	#0000FF	t	t	\N	SOLID	\N	\N	\N	1	\N	1	\N
6	CONSTANT	#800080	t	t	\N	SOLID	\N	1	\N	\N	\N	1	\N
7	INSTRUMENT	#0000FF	t	t	\N	SOLID	\N	\N	\N	1	\N	2	\N
9	CONSTANT	#800080	t	t	\N	SOLID	\N	1	\N	\N	\N	2	\N
10	STATISTICAL_LIMIT	#AA0000	t	t	STATISTICAL_UPPER	DASHED	\N	\N	\N	\N	\N	2	1
8	OUTPUT	#EEFF00	t	t	\N	DOTTED	\N	\N	\N	\N	1	2	\N
11	STATISTICAL_LIMIT	#000000	t	t	STATISTICAL_LOWER	SOLID	\N	\N	\N	\N	\N	2	1
12	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	2	3	\N
13	CONSTANT	#800080	t	t	\N	SOLID	\N	2	\N	\N	\N	3	\N
15	CONSTANT	#800080	t	t	\N	SOLID	\N	3	\N	\N	\N	4	\N
16	STATISTICAL_LIMIT	#00AA00	t	t	STATISTICAL_LOWER	DASHED	\N	\N	\N	\N	\N	4	2
17	STATISTICAL_LIMIT	#AA0000	t	t	STATISTICAL_UPPER	DASHED	\N	\N	\N	\N	\N	4	2
19	CONSTANT	#800080	t	t	\N	SOLID	\N	4	\N	\N	\N	5	\N
20	STATISTICAL_LIMIT	#00AA00	t	t	STATISTICAL_LOWER	DASHED	\N	\N	\N	\N	\N	5	3
21	STATISTICAL_LIMIT	#AA0000	t	t	STATISTICAL_UPPER	DASHED	\N	\N	\N	\N	\N	5	3
22	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	5	6	\N
23	CONSTANT	#800080	t	t	\N	SOLID	\N	5	\N	\N	\N	6	\N
24	LINIMETRIC_RULER	#00FFFF	t	t	\N	SOLID	\N	\N	\N	6	\N	7	\N
25	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	6	7	\N
28	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	8	9	\N
29	CONSTANT	#800080	t	t	\N	SOLID	\N	7	\N	\N	\N	9	\N
30	STATISTICAL_LIMIT	#00AA00	t	t	STATISTICAL_LOWER	DASHED	\N	\N	\N	\N	\N	9	4
31	STATISTICAL_LIMIT	#AA0000	t	t	STATISTICAL_UPPER	DASHED	\N	\N	\N	\N	\N	9	4
33	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	9	10	\N
34	INSTRUMENT	#0000FF	t	t	\N	SOLID	\N	\N	\N	4	\N	11	\N
35	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	4	11	\N
36	CONSTANT	#800080	t	t	\N	SOLID	\N	4	\N	\N	\N	11	\N
18	OUTPUT	#FF0000	t	t	\N	DASH_DOT_DOT	\N	\N	\N	\N	4	5	\N
78	INSTRUMENT	#0000FF	t	t	\N	SOLID	\N	\N	\N	26	\N	13	\N
66	OUTPUT	#FF0000	t	t	\N	DASH_DOT_DOT		\N	\N	\N	3	22	\N
65	INSTRUMENT	#0000FF	t	t	\N	SOLID	\N	\N	\N	3	\N	22	\N
1	OUTPUT	#FF0000	t	t	\N	DASH_DOT_DOT	Dados Coletados	\N	\N	\N	1	1	\N
37	STATISTICAL_LIMIT	#AA0000	t	t	STATISTICAL_UPPER	DASH_DOT_DOT	\N	\N	\N	\N	\N	11	3
38	STATISTICAL_LIMIT	#00AA00	t	t	STATISTICAL_LOWER	DASH_DOT	\N	\N	\N	\N	\N	11	3
39	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	11	13	\N
40	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	10	12	\N
41	CONSTANT	#800080	t	t	\N	SOLID	\N	8	\N	\N	\N	12	\N
42	CONSTANT	#800080	t	t	\N	SOLID	\N	9	\N	\N	\N	13	\N
43	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	12	14	\N
44	CONSTANT	#800080	t	t	\N	SOLID	\N	10	\N	\N	\N	14	\N
45	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	13	15	\N
46	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	14	16	\N
47	CONSTANT	#800080	t	t	\N	SOLID	\N	11	\N	\N	\N	16	\N
32	LINIMETRIC_RULER	#009494	t	t	\N	DASH_DOT_DOT		\N	\N	9	\N	10	\N
48	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	15	17	\N
49	CONSTANT	#800080	t	t	\N	SOLID	\N	12	\N	\N	\N	17	\N
50	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	16	18	\N
51	CONSTANT	#800080	t	t	\N	SOLID	\N	13	\N	\N	\N	18	\N
52	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	17	19	\N
53	CONSTANT	#800080	t	t	\N	SOLID	\N	14	\N	\N	\N	19	\N
54	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	18	20	\N
55	CONSTANT	#800080	t	t	\N	SOLID	\N	15	\N	\N	\N	20	\N
56	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	19	21	\N
73	INSTRUMENT	#0000FF	t	t	\N	SOLID	\N	\N	\N	3	\N	23	\N
74	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	3	23	\N
75	CONSTANT	#800080	t	t	\N	SOLID	\N	3	\N	\N	\N	23	\N
76	STATISTICAL_LIMIT	#00AA00	t	t	STATISTICAL_LOWER	DASHED	\N	\N	\N	\N	\N	23	2
77	STATISTICAL_LIMIT	#AA0000	t	t	STATISTICAL_UPPER	DASHED	\N	\N	\N	\N	\N	23	2
87	INSTRUMENT	#0000FF	t	t	\N	SOLID	\N	\N	\N	28	\N	24	\N
88	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	13	24	\N
89	INSTRUMENT	#0000FF	t	t	\N	SOLID	\N	\N	\N	25	\N	24	\N
90	INSTRUMENT	#0000FF	t	t	\N	SOLID	\N	\N	\N	26	\N	24	\N
91	INSTRUMENT	#0000FF	t	t	\N	SOLID	\N	\N	\N	27	\N	24	\N
92	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	10	24	\N
93	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	11	24	\N
94	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	12	24	\N
95	CONSTANT	#800080	t	t	\N	SOLID	\N	8	\N	\N	\N	24	\N
96	CONSTANT	#800080	t	t	\N	SOLID	\N	9	\N	\N	\N	24	\N
97	CONSTANT	#800080	t	t	\N	SOLID	\N	10	\N	\N	\N	24	\N
14	OUTPUT	#0033FF	t	t	\N	DASH_DOT_DOT	\N	\N	\N	\N	3	4	\N
98	DETERMINISTIC_LIMIT	#FFFF00	t	t	DETERMINISTIC_ATTENTION	DASHED	\N	\N	2	\N	\N	24	\N
99	DETERMINISTIC_LIMIT	#FFA500	t	t	DETERMINISTIC_ALERT	DASHED	\N	\N	2	\N	\N	24	\N
100	DETERMINISTIC_LIMIT	#FF0000	t	t	DETERMINISTIC_EMERGENCY	DASHED	\N	\N	2	\N	\N	24	\N
101	DETERMINISTIC_LIMIT	#FFFF00	t	t	DETERMINISTIC_ATTENTION	DASHED	\N	\N	1	\N	\N	24	\N
102	DETERMINISTIC_LIMIT	#FFA500	t	t	DETERMINISTIC_ALERT	DASHED	\N	\N	1	\N	\N	24	\N
103	DETERMINISTIC_LIMIT	#FF0000	t	t	DETERMINISTIC_EMERGENCY	DASHED	\N	\N	1	\N	\N	24	\N
106	LINIMETRIC_RULER	#00FFFF	t	t	\N	SOLID	\N	\N	\N	9	\N	22	\N
107	LINIMETRIC_RULER	#1EFF00	t	t	\N	SOLID	\N	\N	\N	35	\N	22	\N
108	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	22	25	\N
109	CONSTANT	#800080	t	t	\N	SOLID	\N	16	\N	\N	\N	25	\N
110	INSTRUMENT	#0000FF	t	t	\N	SOLID	\N	\N	\N	37	\N	26	\N
111	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	22	26	\N
112	CONSTANT	#800080	t	t	\N	SOLID	\N	16	\N	\N	\N	26	\N
113	LINIMETRIC_RULER	#00FFFF	t	t	\N	SOLID	\N	\N	\N	38	\N	26	\N
114	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	24	27	\N
115	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	25	28	\N
116	CONSTANT	#800080	t	t	\N	SOLID	\N	18	\N	\N	\N	28	\N
117	CONSTANT	#800080	t	t	\N	SOLID	\N	17	\N	\N	\N	27	\N
118	OUTPUT	#FF0000	t	t	\N	SOLID	\N	\N	\N	\N	26	29	\N
\.


--
-- Data for Name: instrument_graph_pattern; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.instrument_graph_pattern (id, name, folder_id, instrument_id) FROM stdin;
1	Padrão Automático - PZ-01	\N	1
2	Padrao	\N	1
3	Padrão Automático - PZ-02	\N	2
4	Padrão Automático - PZ-01	\N	3
5	Padrão Automático - PZ-012	\N	4
6	Padrão Automático - PZ-013	\N	5
7	RAA	1	6
9	Padrão Automático - EXEMPLO	\N	8
10	REGUA JUSANTE	2	9
11	cccc	2	4
12	Padrão Automático - PZ-01	\N	25
13	Padrão Automático - PZ-012	\N	26
14	Padrão Automático - PZ-013	\N	27
15	Padrão Automático - REGUA	\N	28
16	Padrão Automático - PZ-01-OLD	\N	29
17	Padrão Automático - PZ-01-OLD	\N	30
18	Padrão Automático - PZ-01	\N	31
19	Padrão Automático - PZ-012	\N	32
20	Padrão Automático - PZ-013	\N	33
21	Padrão Automático - REGUA	\N	34
22	Teste	2	3
23	regua jusante	2	3
24	Grafico Teste	\N	25
25	Padrão Automático - PZ-32	\N	37
26	TESTE	\N	37
27	Padrão Automático - PZ-012	\N	39
28	Padrão Automático - PZ-013	\N	40
29	Padrão Automático - REGUA	\N	41
\.


--
-- Data for Name: instrument_graph_pattern_folder; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.instrument_graph_pattern_folder (id, name, dam_id) FROM stdin;
1	Graficos teste	1
2	REGUAS	2
\.


--
-- Data for Name: instrument_tabulate_association; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.instrument_tabulate_association (id, date_index, hour_index, is_date_enable, is_hour_enable, is_read_enable, is_user_enable, user_index, instrument_id, pattern_id) FROM stdin;
1	1	2	t	t	t	t	3	1	1
3	1	2	t	t	t	t	3	2	3
6	1	2	t	t	t	t	3	3	5
7	1	2	t	t	t	t	3	4	6
8	1	2	t	t	t	t	3	5	7
9	1	2	t	t	t	t	3	8	8
19	1	2	t	t	t	t	3	25	18
20	1	2	t	t	t	t	3	26	17
21	1	2	t	t	t	t	3	27	19
22	1	2	t	t	t	t	3	28	20
29	1	2	t	t	t	t	3	7	27
30	1	2	t	t	t	t	3	29	28
34	1	2	t	t	t	t	3	30	31
35	1	2	t	t	t	t	3	31	32
36	1	2	t	t	t	t	3	32	33
37	1	2	t	t	t	t	3	33	34
38	1	2	t	t	t	t	3	34	35
40	8	\N	t	f	t	f	\N	26	37
41	6	\N	t	f	t	t	1	25	37
42	7	\N	t	f	t	t	3	28	37
43	6	\N	t	f	t	t	4	27	38
44	5	\N	t	f	t	t	2	26	38
51	1	\N	t	f	f	f	\N	3	45
52	4	3	t	t	t	t	2	30	46
53	12	11	t	t	t	t	10	32	46
54	8	7	t	t	t	t	5	31	46
55	1	2	t	t	t	t	3	37	47
56	5	4	t	t	f	t	6	38	48
57	7	3	t	t	t	t	2	37	48
58	1	2	t	t	t	t	3	39	49
59	1	2	t	t	t	t	3	40	50
60	1	2	t	t	t	t	3	41	51
\.


--
-- Data for Name: instrument_tabulate_output_association; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.instrument_tabulate_output_association (id, output_index, association_id, output_id) FROM stdin;
1	4	1	1
3	4	3	2
6	4	6	3
7	4	7	4
8	4	8	5
9	4	9	8
20	4	19	10
19	4	20	11
21	4	21	12
22	4	22	13
29	5	29	7
30	4	30	14
34	4	34	15
35	4	35	16
36	4	36	17
37	4	37	18
38	4	38	19
40	9	40	11
41	10	41	10
42	11	42	13
43	8	43	12
44	7	44	11
51	2	51	3
52	13	52	15
53	15	53	17
54	14	54	16
55	4	55	22
56	9	56	23
57	8	57	22
59	4	59	25
58	4	58	24
60	4	60	26
\.


--
-- Data for Name: instrument_tabulate_pattern; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.instrument_tabulate_pattern (id, name, dam_id, folder_id) FROM stdin;
1	Padrão Automático - PZ-01	1	\N
3	Padrão Automático - PZ-02	1	\N
5	Padrão Automático - PZ-01	2	\N
6	Padrão Automático - PZ-012	2	\N
7	Padrão Automático - PZ-013	2	\N
8	Padrão Automático - EXEMPLO	1	\N
17	Padrão Automático - PZ-012	3	\N
18	Padrão Automático - PZ-01	3	\N
19	Padrão Automático - PZ-013	3	\N
20	Padrão Automático - REGUA	3	\N
27	Teste YY	1	6
28	Padrão Automático - PZ-01-OLD	2	\N
31	Padrão Automático - PZ-01-OLD	4	\N
32	Padrão Automático - PZ-01	4	\N
33	Padrão Automático - PZ-012	4	\N
34	Padrão Automático - PZ-013	4	\N
35	Padrão Automático - REGUA	4	\N
37	asdasda	3	5
38	teste	3	5
45	teste	2	9
46	teste	4	12
47	Padrão Automático - PZ-32	5	\N
48	PZ-32/JUSANTE	5	13
49	Padrão Automático - PZ-012	1	\N
50	Padrão Automático - PZ-013	1	\N
51	Padrão Automático - REGUA	1	\N
\.


--
-- Data for Name: instrument_tabulate_pattern_folder; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.instrument_tabulate_pattern_folder (id, name, dam_id) FROM stdin;
5	Tabelas	3
6	Estremote	1
8	teste	2
9	testes	2
12	viu que eu falei q ta excluindo !	4
13	TABELAS CRITICAS	5
\.


--
-- Data for Name: instrument_type; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.instrument_type (id, name) FROM stdin;
1	PIEZÔMETRO
2	REGUA
\.


--
-- Data for Name: instrumentation_permissions; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.instrumentation_permissions (id, edit_graphs_default, edit_graphs_local, edit_read, edit_sections, view_graphs, view_read, view_sections, user_id, edit_instruments, view_instruments) FROM stdin;
17	f	f	f	f	f	f	f	13	f	f
18	f	f	f	f	f	f	f	14	f	f
10	f	f	t	f	t	t	f	3	t	t
11	f	f	f	f	t	f	f	8	f	f
9	f	f	f	f	f	f	f	7	f	t
20	f	f	f	f	f	f	f	16	f	f
19	t	t	t	f	t	t	f	15	t	t
21	f	f	f	f	f	f	f	18	f	f
22	f	f	f	f	f	f	f	19	f	f
23	f	f	f	f	f	f	f	20	f	f
14	f	f	f	f	f	f	f	4	f	f
15	t	t	f	f	t	f	f	10	f	f
16	f	f	f	f	f	f	f	11	f	f
\.


--
-- Data for Name: levels; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.levels (id, created_at, name, unit_level, value) FROM stdin;
1	2025-10-23 13:41:04.422811	MÁXIMO	m	200
2	2025-11-17 15:12:17.318203	MÍNIMO	m	5
3	2025-11-18 15:29:22.80692	MAXIMO	m	50
4	2025-12-05 08:42:34.052151	RESERVATORIO 1	m	12
5	2025-12-12 09:22:28.8779	Mínimo Normal (m)	m	150
6	2025-12-12 09:22:28.896094	Máximo Normal	m	180
\.


--
-- Data for Name: measurement_unit; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.measurement_unit (id, acronym, name) FROM stdin;
1	M	Metros
2	CM	Centímetros
3	MM	Milímetros
4	M³	Metros cúbicos
5	M³/S	Metros cúbicos por segundo
6	L/S	Litros por segundo
7	KPA	Quilopascal
8	MPA	Megapascal
9	°C	Graus Celsius
10	%	Percentual
11	M/S	Metros por segundo
12	°	Graus
13	P	12
\.


--
-- Data for Name: options; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.options (id, label, order_index, value) FROM stdin;
1	NE	1	Não Existe
2	PV	2	Primeira Vez
3	AU	3	Aumentou
4	DM	4	Diminuiu
5	DS	5	Desapareceu
6	PC	6	Permaneceu Constante
7	NI	7	Não Inspecionado
8	teste	8	teste
10	5te	9	as
11	SZ	10	Segundavez
12	GP	11	Gabriel Pereira
13	ME	12	Marcos Estremote
\.


--
-- Data for Name: output; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.output (id, acronym, active, equation, name, "precision", instrument_id, measurement_unit_id) FROM stdin;
1	SAIDA	t	 LEI/ CT	SAIDA	6	1	12
3	OUT	t	 LEI* CT	SAIDA	6	3	1
4	OUT	t	 LEI/ CT	SAIDA	6	4	1
5	OUT	t	 LEI/ CT	SAIDA	6	5	1
6	NVL	t	LEI * 1	Nivel	6	6	1
7	OUT	t	 LEI* CT	SAIDA	6	7	1
8	SAIDA	t	 LEI+ CT	SAIDA	6	8	1
9	NVL	t	LEI * 1	Nivel	6	9	1
10	OUT	t	LEI* CT	SAIDA	6	25	1
11	OUT	t	LEI/ CT	SAIDA	6	26	1
12	OUT	t	LEI/ CT	SAIDA	6	27	1
13	NVL	t	LEI * 1	Nivel	6	28	1
14	SAIDA	t	LEI/ CT	SAIDA	6	29	12
15	SAIDA	t	LEI/ CT	SAIDA	6	30	12
16	OUT	t	LEI* CT	SAIDA	6	31	1
17	OUT	t	LEI/ CT	SAIDA	6	32	1
18	OUT	t	LEI/ CT	SAIDA	6	33	1
19	NVL	t	LEI * 1	Nivel	6	34	1
20	NVL	t	LEI * 1	Nivel	6	35	1
21	NVL	t	LEI * 1	Nivel	6	36	1
2	SAIDA	t	 ENT -  CTS	esperada	6	2	1
22	OUTP	t	 LEI +  VA / 2 *  CTS	SAIDA	6	37	1
23	NVL	t	LEI * 1	Nivel	6	38	1
24	OUT	t	LEI/ CT	SAIDA	6	39	1
25	OUT	t	LEI/ CT	SAIDA	6	40	1
26	NVL	t	LEI * 1	Nivel	6	41	1
\.


--
-- Data for Name: potential_damages; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.potential_damages (id, name) FROM stdin;
1	Baixo
2	Médio
3	Alto
\.


--
-- Data for Name: psb_files; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.psb_files (id, content_type, download_url, file_path, filename, original_filename, size, uploaded_at, psb_folder_id, uploaded_by_id) FROM stdin;
3	application/x-sql	/storage/psb/dam-1/004-vistorias/6f2afa76-627a-44a3-a93c-b5dcd1fbbbee.sql	/home/wwgeomprod/public_html/storage/app/public/psb/dam-1/004-vistorias/6f2afa76-627a-44a3-a93c-b5dcd1fbbbee.sql	6f2afa76-627a-44a3-a93c-b5dcd1fbbbee.sql	sistema_patrimonio.sql	10095	2025-11-11 16:15:48.969398	5	2
13	image/png	/storage/psb/dam-4/002-dados/88dc09d9-e0e6-43bc-abfa-654f8d26860b.png	/home/wwgeomprod/public_html/storage/app/public/psb/dam-4/002-dados/88dc09d9-e0e6-43bc-abfa-654f8d26860b.png	88dc09d9-e0e6-43bc-abfa-654f8d26860b.png	REGUA JUSANTE - 18-11-2025.png	73073	2025-11-18 15:31:00.762155	12	2
15	image/jpeg	/storage/psb/dam-4/001-psb/a28f952e-cd54-4193-9e3e-9869eb4fa731.jpg	/home/wwgeomprod/public_html/storage/app/public/psb/dam-4/001-psb/a28f952e-cd54-4193-9e3e-9869eb4fa731.jpg	a28f952e-cd54-4193-9e3e-9869eb4fa731.jpg	IMG_6085.jpg	498042	2025-12-04 23:25:42.911637	11	1
17	image/jpeg	/storage/psb/dam-1/003-vistorias/6bd56b19-cb5e-4bfc-9fff-63ce9264a198.jpg	/home/wwgeomprod/public_html/storage/app/public/psb/dam-1/003-vistorias/6bd56b19-cb5e-4bfc-9fff-63ce9264a198.jpg	6bd56b19-cb5e-4bfc-9fff-63ce9264a198.jpg	IMG_6085.jpg	498042	2025-12-04 23:43:01.880843	5	1
23	application/vnd.openxmlformats-officedocument.spreadsheetml.sheet	/storage/psb/dam-5/001-psb/881ea807-8f90-4ed4-800f-4c6cd7ce6980.xlsx	/home/wwgeomprod/public_html/storage/app/public/psb/dam-5/001-psb/881ea807-8f90-4ed4-800f-4c6cd7ce6980.xlsx	881ea807-8f90-4ed4-800f-4c6cd7ce6980.xlsx	Import_Leituras_PZ-32.xlsx	13828	2025-12-05 08:56:43.693265	16	1
24	image/png	/storage/psb/dam-3/002-dados_gerais/ef2d9b00-b20e-4611-a664-94338c34166e.png	/home/wwgeomprod/public_html/storage/app/public/psb/dam-3/002-dados_gerais/ef2d9b00-b20e-4611-a664-94338c34166e.png	ef2d9b00-b20e-4611-a664-94338c34166e.png	Captura de Tela 2025-12-08 às 23.08.46.png	757401	2025-12-10 14:04:17.593244	10	1
25	application/pdf	/storage/psb/dam-3/001-pasta_dados_gerais_2/80b3a20d-2a33-4ab9-a70c-77add4eedaee.pdf	/home/wwgeomprod/public_html/storage/app/public/psb/dam-3/002-dados_gerais/001-pasta_dados_gerais_2/80b3a20d-2a33-4ab9-a70c-77add4eedaee.pdf	80b3a20d-2a33-4ab9-a70c-77add4eedaee.pdf	CNH-e.pdf (1).pdf	291188	2025-12-18 08:50:12.626535	24	1
26	application/pdf	/storage/psb/dam-3/001-plano_de_seguranca_de_barragens/096d1753-7f94-47da-8fe6-03795254863e.pdf	/home/wwgeomprod/public_html/storage/app/public/psb/dam-3/001-plano_de_seguranca_de_barragens/096d1753-7f94-47da-8fe6-03795254863e.pdf	096d1753-7f94-47da-8fe6-03795254863e.pdf	CNH-e.pdf.pdf	213727	2025-12-18 09:13:24.998187	9	1
27	image/jpeg	/storage/psb/dam-3/001-teste/71d3f677-2a3f-414d-befc-e573c15aeb24.jpg	/home/wwgeomprod/public_html/storage/app/public/psb/dam-3/002-dados_gerais/001-pasta_dados_gerais_2/002-teste/001-teste/001-teste/71d3f677-2a3f-414d-befc-e573c15aeb24.jpg	71d3f677-2a3f-414d-befc-e573c15aeb24.jpg	IMG_6085.jpg	498042	2025-12-18 10:09:12.627678	31	1
28	image/jpeg	/storage/psb/dam-3/001-plano_de_seguranca_de_barragens/39b3f707-398b-499a-931c-008221aa665f.jpg	/home/wwgeomprod/public_html/storage/app/public/psb/dam-3/001-plano_de_seguranca_de_barragens/39b3f707-398b-499a-931c-008221aa665f.jpg	39b3f707-398b-499a-931c-008221aa665f.jpg	IMG_6085.jpg	498042	2025-12-18 10:09:39.942055	9	1
29	image/jpeg	/storage/psb/dam-3/001-pasta_dados_gerais_2/b19e5681-6035-4bc2-8008-f7e297537c24.jpg	/home/wwgeomprod/public_html/storage/app/public/psb/dam-3/002-dados_gerais/001-pasta_dados_gerais_2/b19e5681-6035-4bc2-8008-f7e297537c24.jpg	b19e5681-6035-4bc2-8008-f7e297537c24.jpg	IMG_6085.jpg	498042	2025-12-18 10:10:21.519826	24	1
30	application/vnd.openxmlformats-officedocument.wordprocessingml.document	/storage/psb/dam-3/001-pasta_interior/d0e40309-8a0e-45d8-a125-3d6d31756d41.docx	/home/wwgeomprod/public_html/storage/app/public/psb/dam-3/002-dados_gerais/001-pasta_dados_gerais_2/002-teste/001-teste/001-teste/001-pasta_interior/d0e40309-8a0e-45d8-a125-3d6d31756d41.docx	d0e40309-8a0e-45d8-a125-3d6d31756d41.docx	8f9ec573-d7ed-411b-9b72-96aaae1195b4.docx	1028373	2025-12-18 10:47:32.89632	32	1
31	application/pdf	/storage/psb/dam-2/002-teste2/26c788f0-84b9-45c1-8696-a4055c35c840.pdf	/home/wwgeomprod/public_html/storage/app/public/psb/dam-2/002-teste2/26c788f0-84b9-45c1-8696-a4055c35c840.pdf	26c788f0-84b9-45c1-8696-a4055c35c840.pdf	Resolução SGGD nº 59, de 04-12-25.pdf	956028	2025-12-18 11:12:59.644162	22	2
33	application/pdf	/storage/psb/dam-2/001-graficos/392b48b1-4fbf-4cfd-9b5e-ed8057eee9ee.pdf	/home/wwgeomprod/public_html/storage/app/public/psb/dam-2/002-teste2/001-graficos/392b48b1-4fbf-4cfd-9b5e-ed8057eee9ee.pdf	392b48b1-4fbf-4cfd-9b5e-ed8057eee9ee.pdf	manuscript-22422.pdf	633413	2025-12-18 15:46:29.397676	34	2
34	image/png	/storage/psb/dam-4/003-pasta_3/25ba0863-d55d-4ff2-a06f-abaf8c8f3e03.png	/home/wwgeomprod/public_html/storage/app/public/psb/dam-4/003-pasta_3/25ba0863-d55d-4ff2-a06f-abaf8c8f3e03.png	25ba0863-d55d-4ff2-a06f-abaf8c8f3e03.png	geosegbar_logo.png	16663	2025-12-19 10:38:43.950938	13	1
36	image/png	/storage/psb/dam-4/003-pasta_3/001-teste/7adba0dd-6ae1-4a21-aa4a-eeff9cde35d4.png	/home/wwgeomprod/public_html/storage/app/public/psb/dam-4/003-pasta_3/001-teste/7adba0dd-6ae1-4a21-aa4a-eeff9cde35d4.png	7adba0dd-6ae1-4a21-aa4a-eeff9cde35d4.png	geosegbar_logo.png	16663	2025-12-19 11:06:11.477207	35	1
\.


--
-- Data for Name: psb_folders; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.psb_folders (id, color, created_at, description, folder_index, name, server_path, updated_at, created_by, dam_id, parent_folder_id) FROM stdin;
9	BLUE	2025-11-17 15:12:17.367889	PSB	1	PLANO DE SEGURANÇA DE BARRAGENS	/home/wwgeomprod/public_html/storage/app/public/psb/dam-3/001-plano_de_seguranca_de_barragens	2025-11-17 15:12:17.36791	2	3	\N
10	RED	2025-11-17 15:12:17.381411	DG	2	DADOS GERAIS	/home/wwgeomprod/public_html/storage/app/public/psb/dam-3/002-dados_gerais	2025-11-17 15:12:17.381433	2	3	\N
11	BLUE	2025-11-18 15:29:22.836693	PLANO DE SEGURANÇA DE BARRAGENS	1	PSB	/home/wwgeomprod/public_html/storage/app/public/psb/dam-4/001-psb	2025-11-18 15:29:22.836707	2	4	\N
12	RED	2025-11-18 15:29:22.851564	DADOS GERAIS	2	DADOS	/home/wwgeomprod/public_html/storage/app/public/psb/dam-4/002-dados	2025-11-18 15:29:22.851578	2	4	\N
13	BLUE	2025-11-18 15:29:22.85952	DADOS DA GEO	3	PASTA 3	/home/wwgeomprod/public_html/storage/app/public/psb/dam-4/003-pasta_3	2025-11-18 15:29:22.859535	2	4	\N
14	BLUE	2025-11-18 15:29:22.867606	TESTE	4	AÇÚ	/home/wwgeomprod/public_html/storage/app/public/psb/dam-4/004-acu	2025-11-18 15:29:22.867618	2	4	\N
16	RED	2025-12-05 08:42:34.091834	Planos de segurança de barragem	1	PSB	/home/wwgeomprod/public_html/storage/app/public/psb/dam-5/001-psb	2025-12-05 08:42:34.091854	1	5	\N
20	BLUE	2025-12-12 09:22:28.936119	Vol I	1	Volume I	/home/wwgeomprod/public_html/storage/app/public/psb/dam-7/001-volume_i	2025-12-12 09:22:28.936132	1	7	\N
21	RED	2025-12-12 09:22:28.970093	Volume II	2	Volume II	/home/wwgeomprod/public_html/storage/app/public/psb/dam-7/002-volume_ii	2025-12-12 09:22:28.970104	1	7	\N
5	BLUE	2025-11-11 16:15:27.49182	Vistorias nas Estruturas das Barragens	1	Vistorias	/home/wwgeomprod/public_html/storage/app/public/psb/dam-1/001-vistorias	2025-12-17 18:23:18.102027	2	1	\N
17	RED	2025-12-05 10:16:15.830109	Documentos de Plano de Seguranças	1	PSB	/home/wwgeomprod/public_html/storage/app/public/psb/dam-6/001-psb	2025-12-17 19:17:53.959783	2	6	\N
23	BLUE	2025-12-17 19:17:53.973339		2	teste	/home/wwgeomprod/public_html/storage/app/public/psb/dam-6/002-teste	2025-12-17 19:17:53.973348	1	6	\N
24	BLUE	2025-12-18 08:43:12.08484	\N	1	Pasta dados gerais 2	/home/wwgeomprod/public_html/storage/app/public/psb/dam-3/002-dados_gerais/001-pasta_dados_gerais_2	2025-12-18 08:43:12.084907	1	3	10
26	BLUE	2025-12-18 08:54:10.788164	teste	1	Teste	/home/wwgeomprod/public_html/storage/app/public/psb/dam-3/002-dados_gerais/001-pasta_dados_gerais_2/001-teste	2025-12-18 08:54:10.788256	1	3	24
27	BLUE	2025-12-18 08:54:24.654133	\N	2	teste	/home/wwgeomprod/public_html/storage/app/public/psb/dam-3/002-dados_gerais/001-pasta_dados_gerais_2/002-teste	2025-12-18 08:54:24.654186	1	3	24
28	BLUE	2025-12-18 09:13:39.231831	\N	1	aaaa	/home/wwgeomprod/public_html/storage/app/public/psb/dam-3/001-plano_de_seguranca_de_barragens/001-aaaa	2025-12-18 09:13:39.23185	1	3	9
29	BLUE	2025-12-18 09:27:24.13961	as	1	teste	/home/wwgeomprod/public_html/storage/app/public/psb/dam-3/001-plano_de_seguranca_de_barragens/001-aaaa/001-teste	2025-12-18 09:27:24.139698	1	3	28
30	BLUE	2025-12-18 10:08:37.297065	ww	1	teste	/home/wwgeomprod/public_html/storage/app/public/psb/dam-3/002-dados_gerais/001-pasta_dados_gerais_2/002-teste/001-teste	2025-12-18 10:08:37.29716	1	3	27
31	BLUE	2025-12-18 10:08:56.86252	as	1	teste	/home/wwgeomprod/public_html/storage/app/public/psb/dam-3/002-dados_gerais/001-pasta_dados_gerais_2/002-teste/001-teste/001-teste	2025-12-18 10:08:56.862565	1	3	30
32	BLUE	2025-12-18 10:47:07.143246	\N	1	pasta interior	/home/wwgeomprod/public_html/storage/app/public/psb/dam-3/002-dados_gerais/001-pasta_dados_gerais_2/002-teste/001-teste/001-teste/001-pasta_interior	2025-12-18 10:47:07.143338	1	3	31
19	BLUE	2025-12-10 09:53:08.413624		1	TESTE	/home/wwgeomprod/public_html/storage/app/public/psb/dam-2/001-teste	2025-12-18 11:01:13.665132	2	2	\N
22	RED	2025-12-17 18:38:32.75496	PASTA DE TESTE 2	2	TESTE2	/home/wwgeomprod/public_html/storage/app/public/psb/dam-2/002-teste2	2025-12-18 11:01:13.676392	1	2	\N
34	BLUE	2025-12-18 15:45:34.291685	Gráficos da Estrutura	1	Gráficos	/home/wwgeomprod/public_html/storage/app/public/psb/dam-2/002-teste2/001-graficos	2025-12-18 15:45:34.291836	2	2	22
35	BLUE	2025-12-19 10:41:29.983333	\N	1	Teste	/home/wwgeomprod/public_html/storage/app/public/psb/dam-4/003-pasta_3/001-teste	2025-12-19 10:41:29.983412	1	4	13
\.


--
-- Data for Name: question_option; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.question_option (question_id, option_id) FROM stdin;
1	1
1	2
1	4
1	3
4	13
4	12
4	11
\.


--
-- Data for Name: questionnaire_responses; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.questionnaire_responses (id, created_at, checklist_response_id, dam_id, template_questionnaire_id) FROM stdin;
\.


--
-- Data for Name: questions; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.questions (id, question_text, type) FROM stdin;
1	Opção 01	CHECKBOX
2	OQUE HOUVE?	TEXT
3	Esta tudo certo? 	TEXT
4	Que dia é hoje	CHECKBOX
\.


--
-- Data for Name: reading; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.reading (id, active, calculated_value, comment, date, hour, limit_status, instrument_id, output_id, user_id) FROM stdin;
1	t	2.5	\N	2025-10-23	13:54:00	INFERIOR	1	1	3
2	t	9.75	\N	2025-10-23	13:55:00	NORMAL	1	1	3
40	t	2.4	teste	2025-11-24	22:05:00	NORMAL	26	11	1
41	t	23	\N	2025-11-24	22:06:00	NORMAL	27	12	1
42	t	5	\N	2025-11-26	09:30:00	NORMAL	9	9	2
3	t	6.165	\N	2025-10-23	13:56:00	INFERIOR	1	1	2
43	t	50.057	Leitura automática pela ANA.	2025-11-29	00:30:00	NORMAL	35	20	1
44	t	9	\N	2025-11-29	13:36:00	NORMAL	9	9	2
6	t	12.75	\N	2025-07-28	23:47:31	NORMAL	1	1	1
7	t	12.75	\N	2025-07-28	23:50:01	NORMAL	1	1	1
8	t	22901	\N	2025-07-28	23:56:31	SUPERIOR	1	1	1
9	t	22947	\N	2025-07-28	23:59:01	SUPERIOR	1	1	1
10	t	50	teste	2025-10-03	00:04:50	SUPERIOR	1	1	1
11	t	22962.5	\N	2025-07-28	13:56:30	SUPERIOR	1	1	1
12	t	22947	\N	2025-07-28	13:59:01	SUPERIOR	1	1	1
13	t	4.485	\N	2025-09-12	23:45:23	INFERIOR	1	1	1
14	t	6.395	\N	2025-09-12	23:46:23	INFERIOR	1	1	1
45	t	50.055	Leitura automática pela ANA.	2025-12-01	00:30:00	NORMAL	35	20	1
46	t	-10	\N	2025-12-04	23:58:00	NORMAL	2	2	2
47	t	-11	\N	2025-12-04	23:59:00	NORMAL	2	2	2
48	t	607.32	\N	2025-12-01	12:00:00	NORMAL	37	22	1
49	t	367.1	\N	2025-12-02	13:00:00	NORMAL	37	22	1
20	t	5	\N	2025-11-04	14:08:00	NORMAL	6	6	2
21	t	6	\N	2025-11-04	14:09:00	NORMAL	6	6	2
22	t	1	\N	2025-11-04	14:41:00	NORMAL	7	7	2
50	t	291.1	\N	2025-12-03	14:00:00	NORMAL	37	22	1
51	t	116.32	\N	2025-12-04	15:00:00	NORMAL	37	22	1
25	t	1	\N	2025-11-04	15:18:00	NORMAL	9	9	2
26	t	2	\N	2025-11-04	15:19:00	NORMAL	9	9	2
52	t	5643	LEITURA DE RISCO	2025-12-05	08:50:00	NORMAL	37	22	1
53	t	32	\N	2025-12-05	08:55:00	NORMAL	38	23	1
54	t	50.056	Leitura automática pela ANA.	2025-12-06	00:30:00	NORMAL	35	20	1
31	t	2	\N	2025-11-11	06:37:00	INFERIOR	4	4	2
32	t	0.84	\N	2025-11-11	06:38:00	INFERIOR	4	4	2
55	t	50.058	Leitura automática pela ANA.	2025-12-08	00:30:00	NORMAL	35	20	1
56	t	50.056	Leitura automática pela ANA.	2025-12-09	00:30:00	NORMAL	35	20	1
19	f	1.5	\N	2025-11-04	14:06:00	INFERIOR	1	1	2
4	f	15	\N	2025-10-28	08:18:00	NORMAL	1	1	1
5	f	70	\N	2025-10-27	08:18:00	SUPERIOR	1	1	1
57	t	50.055	Leitura automática pela ANA.	2025-12-11	00:30:00	NORMAL	35	20	1
58	t	8	\N	2025-12-10	07:00:00	NORMAL	40	25	3
33	t	1.046	\N	2025-11-18	07:33:00	NORMAL	26	11	2
59	t	8	\N	2025-12-11	09:00:00	NORMAL	40	25	3
60	t	12	\N	2025-12-11	17:00:00	NORMAL	40	25	3
61	t	50.057	Leitura automática pela ANA.	2025-12-12	00:30:00	NORMAL	35	20	1
62	t	31.2	\N	2025-12-12	10:01:00	NORMAL	25	10	15
63	t	50.06	Leitura automática pela ANA.	2025-12-13	00:30:00	NORMAL	35	20	1
64	t	50.06	Leitura automática pela ANA.	2025-12-14	00:30:00	NORMAL	35	20	1
65	t	50.053	Leitura automática pela ANA.	2025-12-15	00:30:00	NORMAL	35	20	1
66	t	50.054	Leitura automática pela ANA.	2025-12-16	00:30:00	NORMAL	35	20	1
67	t	50.053	Leitura automática pela ANA.	2025-12-18	00:30:00	NORMAL	35	20	1
68	t	50.053	Leitura automática pela ANA.	2025-12-19	00:30:00	NORMAL	35	20	1
69	t	50.009	Leitura automática pela ANA.	2025-12-20	00:30:00	NORMAL	35	20	1
35	t	2	\N	2025-11-18	13:24:00	NORMAL	29	14	2
36	t	4	Inserção de dados 	2025-11-18	13:25:00	NORMAL	29	14	2
24	t	2	\N	2025-11-04	14:46:00	NORMAL	8	8	2
23	t	1	\N	2025-11-04	14:45:00	NORMAL	8	8	2
37	t	5	\N	2025-11-18	21:52:00	NORMAL	30	15	2
38	t	3	\N	2025-11-18	21:54:00	NORMAL	30	15	2
39	t	148	\N	2025-11-19	09:16:00	NORMAL	31	16	2
15	t	0	12	2025-10-31	12:42:00	INFERIOR	3	3	1
16	t	0	\N	2025-11-04	12:03:00	INFERIOR	3	3	3
17	t	0	\N	2025-11-04	12:05:00	INFERIOR	3	3	3
18	t	0	\N	2025-11-04	14:04:00	INFERIOR	3	3	3
27	t	5	\N	2025-11-09	18:27:00	NORMAL	3	3	2
28	t	5	\N	2025-11-11	06:31:00	NORMAL	3	3	2
29	t	3	\N	2025-11-11	06:32:00	NORMAL	3	3	2
30	t	8	\N	2025-11-11	06:35:00	SUPERIOR	3	3	2
34	t	12.46	\N	2025-11-18	11:28:00	SUPERIOR	3	3	2
70	t	50.007	Leitura automática pela ANA.	2025-12-21	00:30:00	NORMAL	35	20	1
71	t	49.999	Leitura automática pela ANA.	2025-12-22	00:30:00	NORMAL	35	20	1
72	t	50.007	Leitura automática pela ANA.	2025-12-25	00:30:00	NORMAL	35	20	1
73	t	50.013	Leitura automática pela ANA.	2025-12-26	00:30:00	NORMAL	35	20	1
\.


--
-- Data for Name: reading_input_value; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.reading_input_value (id, input_acronym, input_name, value, reading_id) FROM stdin;
70	LEI	Leitura	50.057	61
71	LEI	LEITURA	15.6	62
72	LEI	Leitura	50.06	63
1	LEI	LEITURA	5	1
2	LEI	LEITURA	19.5	2
3	LEI	LEITURA	12.33	3
4	LEI	LEITURA	30	4
5	LEI	LEITURA	140	5
9	LEI	LEITURA	25.5	6
10	LEI	LEITURA	25.5	7
11	LEI	LEITURA	45802	8
12	LEI	LEITURA	45894	9
13	LEI	LEITURA	100	10
14	LEI	LEITURA	45925	11
15	LEI	LEITURA	45894	12
16	LEI	LEITURA	8.97	13
17	LEI	LEITURA	12.79	14
18	LEI	LEITURA	1212	15
19	LEI	LEITURA	9	16
20	LEI	LEITURA	5	17
21	LEI	LEITURA	9	18
22	LEI	LEITURA	3	19
23	LEI	Leitura	5	20
24	LEI	Leitura	6	21
25	LEI	LEITURA	1	22
26	LEI	LEITURA	1	23
27	LEI	LEITURA	2	24
28	LEI	Leitura	1	25
29	LEI	Leitura	2	26
31	LEI	LEITURA	5	27
32	LEI	LEITURA	5	28
33	LEI	LEITURA	3	29
34	LEI	LEITURA	4	30
35	LEI	LEITURA	10	31
36	LEI	LEITURA	4.2	32
37	LEI	LEITURA	5.23	33
38	LEI	LEITURA	6.23	34
39	LEI	LEITURA	4	35
40	LEI	LEITURA	8	36
41	LEI	LEITURA	10	37
42	LEI	LEITURA	6	38
43	LEI	LEITURA	74	39
44	LEI	LEITURA	12	40
45	LEI	LEITURA	23	41
46	LEI	Leitura	5	42
47	LEI	Leitura	50.057	43
48	LEI	Leitura	9	44
49	LEI	Leitura	50.055	45
50	ENT	Entrada de agua	2	46
51	ENT	Entrada de agua	1	47
52	LEI	LEITURA	12	48
53	VA	VAZAO	54.12	48
54	LEI	LEITURA	14	49
55	VA	VAZAO	32.1	49
56	LEI	LEITURA	15	50
57	VA	VAZAO	25.1	50
58	LEI	LEITURA	16	51
59	VA	VAZAO	9.12	51
60	VA	VAZAO	501	52
61	LEI	LEITURA	132	52
62	LEI	Leitura	32	53
63	LEI	Leitura	50.056	54
64	LEI	Leitura	50.058	55
65	LEI	Leitura	50.056	56
66	LEI	Leitura	50.055	57
67	LEI	LEITURA	8	58
68	LEI	LEITURA	8	59
69	LEI	LEITURA	12	60
73	LEI	Leitura	50.06	64
74	LEI	Leitura	50.053	65
75	LEI	Leitura	50.054	66
76	LEI	Leitura	50.053	67
77	LEI	Leitura	50.053	68
78	LEI	Leitura	50.009	69
79	LEI	Leitura	50.007	70
80	LEI	Leitura	49.999	71
81	LEI	Leitura	50.007	72
82	LEI	Leitura	50.013	73
\.


--
-- Data for Name: regulatory_dam; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.regulatory_dam (id, frame_pnsb, representative_email, representative_name, representative_phone, supervisory_body_name, technical_manager_email, technical_manager_name, technical_manager_phone, classification_dam_id, dam_id, potential_damage_id, risk_category_id, security_level_id) FROM stdin;
1	t	estremot@gmail.com	Marcos Antonio Estremote	18981871485	AGENCIA NACIONAL DAS ÁGUAS	estremote@gmail.com	Marcelo Estremote	18996322075	2	1	1	1	1
2	t	ESTREMOT@GMAIL.COM	MARCOS ANTONIO ESTREMOTE	18981871485	ANA	MARCELO@GMAIL.COM	MARCELO ESTREMOTE	18981871485	2	2	1	1	1
3	t	estremot@gmail.com	MARCOS ANTONIO	18981871485	ANA	marcelo@email.com	MARCELO	18981871485	3	3	1	1	1
4	t	teste@email.com	TESTE	18981871485	ANA	teste2@gmail.com	teste2	18981871485	2	4	1	1	1
5	t	vinicius@somosdevteam.com	vinicius mendes	12312312312	Gabriel Pereira	marcos@estremote.com	marcos estremote	12312312312	3	5	3	3	2
6	t	marcos@email.com	Marcos	18981871485	ana	elaine@email.com	Elaine	18981871485	3	6	2	1	1
7	t	pedro@email.com	Pedro	18997997658	ANEEL/CETESB	sismoto@email.com	Sismoto	18965589654	1	7	2	1	1
\.


--
-- Data for Name: reservoirs; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.reservoirs (id, created_at, dam_id, level_id) FROM stdin;
17	2025-11-18 11:16:16.335341	3	1
18	2025-11-18 11:16:16.337845	3	2
20	2025-11-18 15:29:22.812332	4	3
21	2025-11-18 15:29:22.816968	4	2
23	2025-12-05 08:42:34.057732	5	4
26	2025-12-12 09:22:28.886443	7	5
27	2025-12-12 09:22:28.897824	7	6
31	2025-12-17 18:23:18.046187	1	1
34	2025-12-17 19:17:53.903987	6	3
35	2025-12-17 19:17:53.91345	6	2
36	2025-12-18 11:01:13.622898	2	1
\.


--
-- Data for Name: risk_categories; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.risk_categories (id, name) FROM stdin;
1	Baixo
2	Médio
3	Alto
\.


--
-- Data for Name: roles; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.roles (id, description, name) FROM stdin;
1	Administrador: possui acesso total ao sistema.	ADMIN
2	Colaborador: possui acesso limitado ao sistema.	COLLABORATOR
\.


--
-- Data for Name: routine_inspection_permissions; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.routine_inspection_permissions (id, is_fill_mobile, is_fill_web, user_id) FROM stdin;
9	f	f	7
11	f	f	8
10	f	f	3
14	f	f	4
15	f	f	10
16	f	f	11
17	f	f	13
18	f	f	14
19	f	f	15
20	f	f	16
21	f	f	18
22	f	f	19
23	f	f	20
\.


--
-- Data for Name: section; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.section (id, file_path, first_vertex_latitude, first_vertex_longitude, name, second_vertex_latitude, second_vertex_longitude, dam_id) FROM stdin;
\.


--
-- Data for Name: security_levels; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.security_levels (id, level) FROM stdin;
1	Normal
2	Atenção
3	Alerta
4	Emergência
\.


--
-- Data for Name: sex; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.sex (id, name) FROM stdin;
1	Feminino
2	Masculino
\.


--
-- Data for Name: statistical_limit; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.statistical_limit (id, lower_value, upper_value, output_id) FROM stdin;
1	8	15	1
2	2.55	5.33	3
3	3.5	10.5	4
4	1	2	8
\.


--
-- Data for Name: status; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.status (id, status) FROM stdin;
1	ACTIVE
2	DISABLED
\.


--
-- Data for Name: template_questionnaire_questions; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.template_questionnaire_questions (id, order_index, question_id, template_questionnaire_id) FROM stdin;
1	0	3	3
2	1	2	3
3	3	4	4
4	2	1	4
5	0	3	4
6	1	2	4
\.


--
-- Data for Name: template_questionnaires; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.template_questionnaires (id, name) FROM stdin;
1	Crista/Coroamento
2	Coroamento
3	Crista/Coroamento
4	Modelo 2
\.


--
-- Data for Name: user_client; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.user_client (user_id, client_id) FROM stdin;
7	7
4	1
10	9
8	1
11	1
16	7
15	7
3	1
13	11
18	7
20	1
\.


--
-- Data for Name: verification_codes; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.verification_codes (id, code, expiry_date, used, user_id) FROM stdin;
\.



--
-- Name: anomalies anomalies_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.anomalies
    ADD CONSTRAINT anomalies_pkey PRIMARY KEY (id);


--
-- Name: anomaly_photos anomaly_photos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.anomaly_photos
    ADD CONSTRAINT anomaly_photos_pkey PRIMARY KEY (id);


--
-- Name: anomaly_status anomaly_status_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.anomaly_status
    ADD CONSTRAINT anomaly_status_pkey PRIMARY KEY (id);


--
-- Name: answer_options answer_options_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.answer_options
    ADD CONSTRAINT answer_options_pkey PRIMARY KEY (answer_id, option_id);


--
-- Name: answer_photos answer_photos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.answer_photos
    ADD CONSTRAINT answer_photos_pkey PRIMARY KEY (id);


--
-- Name: answers answers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.answers
    ADD CONSTRAINT answers_pkey PRIMARY KEY (id);


--
-- Name: attributions_permissions attributions_permissions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.attributions_permissions
    ADD CONSTRAINT attributions_permissions_pkey PRIMARY KEY (id);


--
-- Name: checklist_responses checklist_responses_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.checklist_responses
    ADD CONSTRAINT checklist_responses_pkey PRIMARY KEY (id);


--
-- Name: checklist_template_questionnaire checklist_template_questionnaire_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.checklist_template_questionnaire
    ADD CONSTRAINT checklist_template_questionnaire_pkey PRIMARY KEY (checklist_id, template_questionnaire_id);


--
-- Name: checklists checklists_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.checklists
    ADD CONSTRAINT checklists_pkey PRIMARY KEY (id);


--
-- Name: classification_dams classification_dams_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.classification_dams
    ADD CONSTRAINT classification_dams_pkey PRIMARY KEY (id);


--
-- Name: client client_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.client
    ADD CONSTRAINT client_pkey PRIMARY KEY (id);


--
-- Name: constant constant_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.constant
    ADD CONSTRAINT constant_pkey PRIMARY KEY (id);


--
-- Name: dam_permissions dam_permissions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dam_permissions
    ADD CONSTRAINT dam_permissions_pkey PRIMARY KEY (id);


--
-- Name: dam dam_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dam
    ADD CONSTRAINT dam_pkey PRIMARY KEY (id);


--
-- Name: danger_levels danger_levels_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.danger_levels
    ADD CONSTRAINT danger_levels_pkey PRIMARY KEY (id);


--
-- Name: deterministic_limit deterministic_limit_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.deterministic_limit
    ADD CONSTRAINT deterministic_limit_pkey PRIMARY KEY (id);


--
-- Name: documentation_dam documentation_dam_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.documentation_dam
    ADD CONSTRAINT documentation_dam_pkey PRIMARY KEY (id);


--
-- Name: documentation_permissions documentation_permissions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.documentation_permissions
    ADD CONSTRAINT documentation_permissions_pkey PRIMARY KEY (id);


--
-- Name: classification_dams idx_classification_value; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.classification_dams
    ADD CONSTRAINT idx_classification_value UNIQUE (classification);


--
-- Name: client idx_client_email; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.client
    ADD CONSTRAINT idx_client_email UNIQUE (email);


--
-- Name: client idx_client_name; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.client
    ADD CONSTRAINT idx_client_name UNIQUE (name);


--
-- Name: documentation_dam idx_doc_dam_dam_id; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.documentation_dam
    ADD CONSTRAINT idx_doc_dam_dam_id UNIQUE (dam_id);


--
-- Name: levels idx_level_name; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.levels
    ADD CONSTRAINT idx_level_name UNIQUE (name);


--
-- Name: options idx_option_label; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.options
    ADD CONSTRAINT idx_option_label UNIQUE (label);


--
-- Name: potential_damages idx_potential_damage_name; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.potential_damages
    ADD CONSTRAINT idx_potential_damage_name UNIQUE (name);


--
-- Name: regulatory_dam idx_regulatory_dam_dam_id; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.regulatory_dam
    ADD CONSTRAINT idx_regulatory_dam_dam_id UNIQUE (dam_id);


--
-- Name: risk_categories idx_risk_category_name; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.risk_categories
    ADD CONSTRAINT idx_risk_category_name UNIQUE (name);


--
-- Name: roles idx_role_name; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.roles
    ADD CONSTRAINT idx_role_name UNIQUE (name);


--
-- Name: security_levels idx_security_level; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.security_levels
    ADD CONSTRAINT idx_security_level UNIQUE (level);


--
-- Name: status idx_status_enum; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.status
    ADD CONSTRAINT idx_status_enum UNIQUE (status);


--
-- Name: input input_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.input
    ADD CONSTRAINT input_pkey PRIMARY KEY (id);


--
-- Name: instrument_graph_axes instrument_graph_axes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_graph_axes
    ADD CONSTRAINT instrument_graph_axes_pkey PRIMARY KEY (id);


--
-- Name: instrument_graph_customization_properties instrument_graph_customization_properties_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_graph_customization_properties
    ADD CONSTRAINT instrument_graph_customization_properties_pkey PRIMARY KEY (id);


--
-- Name: instrument_graph_pattern_folder instrument_graph_pattern_folder_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_graph_pattern_folder
    ADD CONSTRAINT instrument_graph_pattern_folder_pkey PRIMARY KEY (id);


--
-- Name: instrument_graph_pattern instrument_graph_pattern_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_graph_pattern
    ADD CONSTRAINT instrument_graph_pattern_pkey PRIMARY KEY (id);


--
-- Name: instrument instrument_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument
    ADD CONSTRAINT instrument_pkey PRIMARY KEY (id);


--
-- Name: instrument_tabulate_association instrument_tabulate_association_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_tabulate_association
    ADD CONSTRAINT instrument_tabulate_association_pkey PRIMARY KEY (id);


--
-- Name: instrument_tabulate_output_association instrument_tabulate_output_association_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_tabulate_output_association
    ADD CONSTRAINT instrument_tabulate_output_association_pkey PRIMARY KEY (id);


--
-- Name: instrument_tabulate_pattern_folder instrument_tabulate_pattern_folder_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_tabulate_pattern_folder
    ADD CONSTRAINT instrument_tabulate_pattern_folder_pkey PRIMARY KEY (id);


--
-- Name: instrument_tabulate_pattern instrument_tabulate_pattern_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_tabulate_pattern
    ADD CONSTRAINT instrument_tabulate_pattern_pkey PRIMARY KEY (id);


--
-- Name: instrument_type instrument_type_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_type
    ADD CONSTRAINT instrument_type_pkey PRIMARY KEY (id);


--
-- Name: instrumentation_permissions instrumentation_permissions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrumentation_permissions
    ADD CONSTRAINT instrumentation_permissions_pkey PRIMARY KEY (id);


--
-- Name: levels levels_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.levels
    ADD CONSTRAINT levels_pkey PRIMARY KEY (id);


--
-- Name: measurement_unit measurement_unit_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.measurement_unit
    ADD CONSTRAINT measurement_unit_pkey PRIMARY KEY (id);


--
-- Name: options options_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.options
    ADD CONSTRAINT options_pkey PRIMARY KEY (id);


--
-- Name: output output_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.output
    ADD CONSTRAINT output_pkey PRIMARY KEY (id);


--
-- Name: potential_damages potential_damages_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.potential_damages
    ADD CONSTRAINT potential_damages_pkey PRIMARY KEY (id);


--
-- Name: psb_files psb_files_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.psb_files
    ADD CONSTRAINT psb_files_pkey PRIMARY KEY (id);


--
-- Name: psb_folders psb_folders_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.psb_folders
    ADD CONSTRAINT psb_folders_pkey PRIMARY KEY (id);


--
-- Name: question_option question_option_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.question_option
    ADD CONSTRAINT question_option_pkey PRIMARY KEY (question_id, option_id);


--
-- Name: questionnaire_responses questionnaire_responses_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.questionnaire_responses
    ADD CONSTRAINT questionnaire_responses_pkey PRIMARY KEY (id);


--
-- Name: questions questions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.questions
    ADD CONSTRAINT questions_pkey PRIMARY KEY (id);


--
-- Name: reading_input_value reading_input_value_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.reading_input_value
    ADD CONSTRAINT reading_input_value_pkey PRIMARY KEY (id);


--
-- Name: reading reading_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.reading
    ADD CONSTRAINT reading_pkey PRIMARY KEY (id);


--
-- Name: regulatory_dam regulatory_dam_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.regulatory_dam
    ADD CONSTRAINT regulatory_dam_pkey PRIMARY KEY (id);


--
-- Name: reservoirs reservoirs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.reservoirs
    ADD CONSTRAINT reservoirs_pkey PRIMARY KEY (id);


--
-- Name: risk_categories risk_categories_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.risk_categories
    ADD CONSTRAINT risk_categories_pkey PRIMARY KEY (id);


--
-- Name: roles roles_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.roles
    ADD CONSTRAINT roles_pkey PRIMARY KEY (id);


--
-- Name: routine_inspection_permissions routine_inspection_permissions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.routine_inspection_permissions
    ADD CONSTRAINT routine_inspection_permissions_pkey PRIMARY KEY (id);


--
-- Name: section section_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.section
    ADD CONSTRAINT section_pkey PRIMARY KEY (id);


--
-- Name: security_levels security_levels_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.security_levels
    ADD CONSTRAINT security_levels_pkey PRIMARY KEY (id);


--
-- Name: sex sex_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sex
    ADD CONSTRAINT sex_pkey PRIMARY KEY (id);


--
-- Name: statistical_limit statistical_limit_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.statistical_limit
    ADD CONSTRAINT statistical_limit_pkey PRIMARY KEY (id);


--
-- Name: status status_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.status
    ADD CONSTRAINT status_pkey PRIMARY KEY (id);


--
-- Name: template_questionnaire_questions template_questionnaire_questions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.template_questionnaire_questions
    ADD CONSTRAINT template_questionnaire_questions_pkey PRIMARY KEY (id);


--
-- Name: template_questionnaires template_questionnaires_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.template_questionnaires
    ADD CONSTRAINT template_questionnaires_pkey PRIMARY KEY (id);


--
-- Name: measurement_unit uk1vvd0tjmao71dgo2ancmocayu; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.measurement_unit
    ADD CONSTRAINT uk1vvd0tjmao71dgo2ancmocayu UNIQUE (name);


--
-- Name: deterministic_limit uk4fotk9wwwy8t9cund516ym0n8; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.deterministic_limit
    ADD CONSTRAINT uk4fotk9wwwy8t9cund516ym0n8 UNIQUE (output_id);


--
-- Name: statistical_limit uk5em27xham6w9a56d1ie0a3mij; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.statistical_limit
    ADD CONSTRAINT uk5em27xham6w9a56d1ie0a3mij UNIQUE (output_id);


--
-- Name: documentation_permissions uk5etsi0t66bcbcogt56a7f4kyd; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.documentation_permissions
    ADD CONSTRAINT uk5etsi0t66bcbcogt56a7f4kyd UNIQUE (user_id);


--
-- Name: routine_inspection_permissions uk70w49hgo03per97lr2sjsofjn; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.routine_inspection_permissions
    ADD CONSTRAINT uk70w49hgo03per97lr2sjsofjn UNIQUE (user_id);


--
-- Name: dam_permissions uk9k4u6c1rgg3fwiuvmgp3g46wx; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dam_permissions
    ADD CONSTRAINT uk9k4u6c1rgg3fwiuvmgp3g46wx UNIQUE (user_id, dam_id, client_id);


--
-- Name: attributions_permissions uk9mnnppoxlxm4fdutrst7m7dqi; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.attributions_permissions
    ADD CONSTRAINT uk9mnnppoxlxm4fdutrst7m7dqi UNIQUE (user_id);


--
-- Name: instrument_type uk_instrument_type_name; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_type
    ADD CONSTRAINT uk_instrument_type_name UNIQUE (name);


--
-- Name: instrument_graph_axes ukajv1d6p5oa7j1xewf0t0t9e3a; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_graph_axes
    ADD CONSTRAINT ukajv1d6p5oa7j1xewf0t0t9e3a UNIQUE (pattern_id);


--
-- Name: instrumentation_permissions ukal6ptehcvsbc72dd0uoxmjovv; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrumentation_permissions
    ADD CONSTRAINT ukal6ptehcvsbc72dd0uoxmjovv UNIQUE (user_id);


--
-- Name: danger_levels ukb7cvdwhtv2v8hiejssydwjytu; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.danger_levels
    ADD CONSTRAINT ukb7cvdwhtv2v8hiejssydwjytu UNIQUE (name);


--
-- Name: anomaly_status ukdg1d22ieciexjyclaxeol0sf; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.anomaly_status
    ADD CONSTRAINT ukdg1d22ieciexjyclaxeol0sf UNIQUE (name);


--
-- Name: sex ukdnojox3s9im0dcwpbv3ep2wik; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sex
    ADD CONSTRAINT ukdnojox3s9im0dcwpbv3ep2wik UNIQUE (name);


--
-- Name: measurement_unit uknj5745skr6xqut88m6fbxi1ea; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.measurement_unit
    ADD CONSTRAINT uknj5745skr6xqut88m6fbxi1ea UNIQUE (acronym);


--
-- Name: user_client user_client_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.user_client
    ADD CONSTRAINT user_client_pkey PRIMARY KEY (user_id, client_id);


--
-- Name: verification_codes verification_codes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.verification_codes
    ADD CONSTRAINT verification_codes_pkey PRIMARY KEY (id);


--
-- Name: idx_anomaly_complete_filter; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_anomaly_complete_filter ON public.anomalies USING btree (dam_id, status_id, danger_level_id, created_at DESC);


--
-- Name: idx_anomaly_coordinates; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_anomaly_coordinates ON public.anomalies USING btree (latitude, longitude);


--
-- Name: idx_anomaly_created_at; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_anomaly_created_at ON public.anomalies USING btree (created_at);


--
-- Name: idx_anomaly_created_desc; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_anomaly_created_desc ON public.anomalies USING btree (created_at DESC);


--
-- Name: idx_anomaly_dam_coordinates; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_anomaly_dam_coordinates ON public.anomalies USING btree (dam_id, latitude, longitude);


--
-- Name: idx_anomaly_dam_created; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_anomaly_dam_created ON public.anomalies USING btree (dam_id, created_at DESC);


--
-- Name: idx_anomaly_dam_danger_status; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_anomaly_dam_danger_status ON public.anomalies USING btree (dam_id, danger_level_id, status_id);


--
-- Name: idx_anomaly_dam_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_anomaly_dam_id ON public.anomalies USING btree (dam_id);


--
-- Name: idx_anomaly_dam_status; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_anomaly_dam_status ON public.anomalies USING btree (dam_id, status_id);


--
-- Name: idx_anomaly_danger_created; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_anomaly_danger_created ON public.anomalies USING btree (danger_level_id, created_at DESC);


--
-- Name: idx_anomaly_danger_level_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_anomaly_danger_level_id ON public.anomalies USING btree (danger_level_id);


--
-- Name: idx_anomaly_origin; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_anomaly_origin ON public.anomalies USING btree (origin);


--
-- Name: idx_anomaly_origin_dam; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_anomaly_origin_dam ON public.anomalies USING btree (origin, dam_id);


--
-- Name: idx_anomaly_photo_anomaly_dam; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_anomaly_photo_anomaly_dam ON public.anomaly_photos USING btree (anomaly_id, dam_id);


--
-- Name: idx_anomaly_photo_anomaly_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_anomaly_photo_anomaly_id ON public.anomaly_photos USING btree (anomaly_id);


--
-- Name: idx_anomaly_photo_dam_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_anomaly_photo_dam_id ON public.anomaly_photos USING btree (dam_id);


--
-- Name: idx_anomaly_question_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_anomaly_question_id ON public.anomalies USING btree (question_id);


--
-- Name: idx_anomaly_questionnaire_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_anomaly_questionnaire_id ON public.anomalies USING btree (questionnaire_id);


--
-- Name: idx_anomaly_status_created; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_anomaly_status_created ON public.anomalies USING btree (status_id, created_at DESC);


--
-- Name: idx_anomaly_status_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_anomaly_status_id ON public.anomalies USING btree (status_id);


--
-- Name: idx_anomaly_user_created; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_anomaly_user_created ON public.anomalies USING btree (user_id, created_at DESC);


--
-- Name: idx_anomaly_user_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_anomaly_user_id ON public.anomalies USING btree (user_id);


--
-- Name: idx_answer_coords; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_answer_coords ON public.answers USING btree (latitude, longitude);


--
-- Name: idx_answer_photo_answer_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_answer_photo_answer_id ON public.answer_photos USING btree (answer_id);


--
-- Name: idx_answer_question; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_answer_question ON public.answers USING btree (question_id);


--
-- Name: idx_answer_questionnaire; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_answer_questionnaire ON public.answers USING btree (questionnaire_response_id);


--
-- Name: idx_checklist_created_at; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_checklist_created_at ON public.checklists USING btree (created_at);


--
-- Name: idx_checklist_dam_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_checklist_dam_id ON public.checklists USING btree (dam_id);


--
-- Name: idx_checklist_name; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_checklist_name ON public.checklists USING btree (name);


--
-- Name: idx_checklist_response_checklist_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_checklist_response_checklist_id ON public.checklist_responses USING btree (checklist_id);


--
-- Name: idx_checklist_response_created_at; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_checklist_response_created_at ON public.checklist_responses USING btree (created_at);


--
-- Name: idx_checklist_response_dam_checklist_created; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_checklist_response_dam_checklist_created ON public.checklist_responses USING btree (dam_id, checklist_id, created_at);


--
-- Name: idx_checklist_response_dam_created_desc; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_checklist_response_dam_created_desc ON public.checklist_responses USING btree (dam_id, created_at);


--
-- Name: idx_checklist_response_dam_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_checklist_response_dam_id ON public.checklist_responses USING btree (dam_id);


--
-- Name: idx_checklist_response_dam_period; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_checklist_response_dam_period ON public.checklist_responses USING btree (dam_id, created_at);


--
-- Name: idx_checklist_response_user_created; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_checklist_response_user_created ON public.checklist_responses USING btree (user_id, created_at);


--
-- Name: idx_checklist_response_user_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_checklist_response_user_id ON public.checklist_responses USING btree (user_id);


--
-- Name: idx_client_city; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_client_city ON public.client USING btree (city);


--
-- Name: idx_client_city_state; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_client_city_state ON public.client USING btree (city, state);


--
-- Name: idx_client_email_contact; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_client_email_contact ON public.client USING btree (email_contact);


--
-- Name: idx_client_phone; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_client_phone ON public.client USING btree (phone);


--
-- Name: idx_client_state; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_client_state ON public.client USING btree (state);


--
-- Name: idx_client_state_status; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_client_state_status ON public.client USING btree (state, status_id);


--
-- Name: idx_client_status; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_client_status ON public.client USING btree (status_id);


--
-- Name: idx_client_status_city; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_client_status_city ON public.client USING btree (status_id, city);


--
-- Name: idx_client_status_name; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_client_status_name ON public.client USING btree (status_id, name);


--
-- Name: idx_client_whatsapp; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_client_whatsapp ON public.client USING btree (whatsapp_phone);


--
-- Name: idx_client_zip_code; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_client_zip_code ON public.client USING btree (zip_code);


--
-- Name: idx_constant_acronym; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_constant_acronym ON public.constant USING btree (acronym);


--
-- Name: idx_constant_instrument_acronym; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_constant_instrument_acronym ON public.constant USING btree (instrument_id, acronym);


--
-- Name: idx_constant_instrument_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_constant_instrument_id ON public.constant USING btree (instrument_id);


--
-- Name: idx_dam_city; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_city ON public.dam USING btree (city);


--
-- Name: idx_dam_city_state; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_city_state ON public.dam USING btree (city, state);


--
-- Name: idx_dam_client_coords; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_client_coords ON public.dam USING btree (client_id, latitude, longitude);


--
-- Name: idx_dam_client_geo_status; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_client_geo_status ON public.dam USING btree (client_id, status_id, latitude, longitude);


--
-- Name: idx_dam_client_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_client_id ON public.dam USING btree (client_id);


--
-- Name: idx_dam_client_name; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_client_name ON public.dam USING btree (client_id, name);


--
-- Name: idx_dam_client_status; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_client_status ON public.dam USING btree (client_id, status_id);


--
-- Name: idx_dam_coords; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_coords ON public.dam USING btree (latitude, longitude);


--
-- Name: idx_dam_latitude; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_latitude ON public.dam USING btree (latitude);


--
-- Name: idx_dam_longitude; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_longitude ON public.dam USING btree (longitude);


--
-- Name: idx_dam_name; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_name ON public.dam USING btree (name);


--
-- Name: idx_dam_perm_access; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_perm_access ON public.dam_permissions USING btree (has_access);


--
-- Name: idx_dam_perm_client_access; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_perm_client_access ON public.dam_permissions USING btree (client_id, has_access);


--
-- Name: idx_dam_perm_client_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_perm_client_id ON public.dam_permissions USING btree (client_id);


--
-- Name: idx_dam_perm_created_at; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_perm_created_at ON public.dam_permissions USING btree (created_at);


--
-- Name: idx_dam_perm_created_by; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_perm_created_by ON public.dam_permissions USING btree (created_by);


--
-- Name: idx_dam_perm_dam_access; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_perm_dam_access ON public.dam_permissions USING btree (dam_id, has_access);


--
-- Name: idx_dam_perm_dam_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_perm_dam_id ON public.dam_permissions USING btree (dam_id);


--
-- Name: idx_dam_perm_updated_by; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_perm_updated_by ON public.dam_permissions USING btree (updated_by);


--
-- Name: idx_dam_perm_user_access; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_perm_user_access ON public.dam_permissions USING btree (user_id, has_access);


--
-- Name: idx_dam_perm_user_client; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_perm_user_client ON public.dam_permissions USING btree (user_id, client_id);


--
-- Name: idx_dam_perm_user_dam; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_perm_user_dam ON public.dam_permissions USING btree (user_id, dam_id);


--
-- Name: idx_dam_perm_user_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_perm_user_id ON public.dam_permissions USING btree (user_id);


--
-- Name: idx_dam_state; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_state ON public.dam USING btree (state);


--
-- Name: idx_dam_status_city; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_status_city ON public.dam USING btree (status_id, city);


--
-- Name: idx_dam_status_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_status_id ON public.dam USING btree (status_id);


--
-- Name: idx_dam_zip; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_dam_zip ON public.dam USING btree (zip_code);


--
-- Name: idx_doc_dam_next_checklist; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_doc_dam_next_checklist ON public.documentation_dam USING btree (next_achievement_checklist);


--
-- Name: idx_doc_dam_next_pae; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_doc_dam_next_pae ON public.documentation_dam USING btree (next_update_pae);


--
-- Name: idx_doc_dam_next_psb; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_doc_dam_next_psb ON public.documentation_dam USING btree (next_update_psb);


--
-- Name: idx_graph_axes_pattern; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_graph_axes_pattern ON public.instrument_graph_axes USING btree (pattern_id);


--
-- Name: idx_graph_custom_props_constant; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_graph_custom_props_constant ON public.instrument_graph_customization_properties USING btree (constant_id);


--
-- Name: idx_graph_custom_props_det_limit; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_graph_custom_props_det_limit ON public.instrument_graph_customization_properties USING btree (deterministic_limit_id);


--
-- Name: idx_graph_custom_props_limit_value_type; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_graph_custom_props_limit_value_type ON public.instrument_graph_customization_properties USING btree (limit_value_type);


--
-- Name: idx_graph_custom_props_name; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_graph_custom_props_name ON public.instrument_graph_customization_properties USING btree (name);


--
-- Name: idx_graph_custom_props_output; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_graph_custom_props_output ON public.instrument_graph_customization_properties USING btree (output_id);


--
-- Name: idx_graph_custom_props_stat_limit; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_graph_custom_props_stat_limit ON public.instrument_graph_customization_properties USING btree (statistical_limit_id);


--
-- Name: idx_graph_custom_props_type; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_graph_custom_props_type ON public.instrument_graph_customization_properties USING btree (customization_type);


--
-- Name: idx_graph_pattern_folder; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_graph_pattern_folder ON public.instrument_graph_pattern USING btree (folder_id);


--
-- Name: idx_graph_pattern_folder_dam; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_graph_pattern_folder_dam ON public.instrument_graph_pattern_folder USING btree (dam_id);


--
-- Name: idx_graph_pattern_folder_dam_name; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_graph_pattern_folder_dam_name ON public.instrument_graph_pattern_folder USING btree (dam_id, name);


--
-- Name: idx_graph_pattern_folder_name; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_graph_pattern_folder_name ON public.instrument_graph_pattern USING btree (folder_id, name);


--
-- Name: idx_graph_pattern_instrument; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_graph_pattern_instrument ON public.instrument_graph_pattern USING btree (instrument_id);


--
-- Name: idx_graph_pattern_instrument_name; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_graph_pattern_instrument_name ON public.instrument_graph_pattern USING btree (instrument_id, name);


--
-- Name: idx_graph_pattern_name; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_graph_pattern_name ON public.instrument_graph_pattern USING btree (name);


--
-- Name: idx_input_acronym; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_input_acronym ON public.input USING btree (acronym);


--
-- Name: idx_input_instrument_acronym; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_input_instrument_acronym ON public.input USING btree (instrument_id, acronym);


--
-- Name: idx_input_instrument_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_input_instrument_id ON public.input USING btree (instrument_id);


--
-- Name: idx_instrument_active_section; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_instrument_active_section ON public.instrument USING btree (active, active_for_section);


--
-- Name: idx_instrument_coordinates; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_instrument_coordinates ON public.instrument USING btree (latitude, longitude);


--
-- Name: idx_instrument_dam_active; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_instrument_dam_active ON public.instrument USING btree (dam_id, active);


--
-- Name: idx_instrument_dam_coordinates; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_instrument_dam_coordinates ON public.instrument USING btree (dam_id, latitude, longitude);


--
-- Name: idx_instrument_dam_section; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_instrument_dam_section ON public.instrument USING btree (dam_id, section_id);


--
-- Name: idx_instrument_dam_type; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_instrument_dam_type ON public.instrument USING btree (dam_id, instrument_type_id);


--
-- Name: idx_instrument_linimetric; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_instrument_linimetric ON public.instrument USING btree (is_linimetric_ruler);


--
-- Name: idx_instrument_name; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_instrument_name ON public.instrument USING btree (name);


--
-- Name: idx_instrument_section_active; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_instrument_section_active ON public.instrument USING btree (section_id, active);


--
-- Name: idx_instrument_type_active; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_instrument_type_active ON public.instrument USING btree (instrument_type_id, active);


--
-- Name: idx_instrument_type_name_search; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_instrument_type_name_search ON public.instrument_type USING btree (name);


--
-- Name: idx_level_value; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_level_value ON public.levels USING btree (value);


--
-- Name: idx_option_order; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_option_order ON public.options USING btree (order_index);


--
-- Name: idx_option_value; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_option_value ON public.options USING btree (value);


--
-- Name: idx_output_acronym; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_output_acronym ON public.output USING btree (acronym);


--
-- Name: idx_output_active; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_output_active ON public.output USING btree (active);


--
-- Name: idx_output_instrument_acronym; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_output_instrument_acronym ON public.output USING btree (instrument_id, acronym);


--
-- Name: idx_output_instrument_active; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_output_instrument_active ON public.output USING btree (instrument_id, active);


--
-- Name: idx_output_measurement_unit; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_output_measurement_unit ON public.output USING btree (measurement_unit_id, instrument_id);


--
-- Name: idx_psb_file_filename; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_psb_file_filename ON public.psb_files USING btree (filename);


--
-- Name: idx_psb_file_folder_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_psb_file_folder_id ON public.psb_files USING btree (psb_folder_id);


--
-- Name: idx_psb_file_folder_uploaded; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_psb_file_folder_uploaded ON public.psb_files USING btree (psb_folder_id, uploaded_at);


--
-- Name: idx_psb_file_uploaded_by_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_psb_file_uploaded_by_id ON public.psb_files USING btree (uploaded_by_id);


--
-- Name: idx_psb_folder_created_by; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_psb_folder_created_by ON public.psb_folders USING btree (created_by);


--
-- Name: idx_psb_folder_dam_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_psb_folder_dam_id ON public.psb_folders USING btree (dam_id);


--
-- Name: idx_psb_folder_dam_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_psb_folder_dam_idx ON public.psb_folders USING btree (dam_id, folder_index);


--
-- Name: idx_psb_folder_dam_name; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_psb_folder_dam_name ON public.psb_folders USING btree (dam_id, name);


--
-- Name: idx_psb_folder_parent_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_psb_folder_parent_id ON public.psb_folders USING btree (parent_folder_id);


--
-- Name: idx_psb_folder_parent_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_psb_folder_parent_idx ON public.psb_folders USING btree (parent_folder_id, folder_index);


--
-- Name: idx_psb_folder_updated_at; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_psb_folder_updated_at ON public.psb_folders USING btree (updated_at);


--
-- Name: idx_question_type; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_question_type ON public.questions USING btree (type);


--
-- Name: idx_questionnaire_response_checklist_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_questionnaire_response_checklist_id ON public.questionnaire_responses USING btree (checklist_response_id);


--
-- Name: idx_questionnaire_response_dam_created; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_questionnaire_response_dam_created ON public.questionnaire_responses USING btree (dam_id, created_at);


--
-- Name: idx_questionnaire_response_dam_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_questionnaire_response_dam_id ON public.questionnaire_responses USING btree (dam_id);


--
-- Name: idx_questionnaire_response_template_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_questionnaire_response_template_id ON public.questionnaire_responses USING btree (template_questionnaire_id);


--
-- Name: idx_reading_active; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reading_active ON public.reading USING btree (active);


--
-- Name: idx_reading_active_date; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reading_active_date ON public.reading USING btree (active, date DESC);


--
-- Name: idx_reading_date_hour_status; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reading_date_hour_status ON public.reading USING btree (date DESC, hour DESC, limit_status);


--
-- Name: idx_reading_date_instrument_status; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reading_date_instrument_status ON public.reading USING btree (date DESC, instrument_id, limit_status);


--
-- Name: idx_reading_date_range; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reading_date_range ON public.reading USING btree (date);


--
-- Name: idx_reading_date_time_combined; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reading_date_time_combined ON public.reading USING btree (date DESC, hour DESC);


--
-- Name: idx_reading_input_value_acronym; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reading_input_value_acronym ON public.reading_input_value USING btree (input_acronym);


--
-- Name: idx_reading_input_value_reading; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reading_input_value_reading ON public.reading_input_value USING btree (reading_id);


--
-- Name: idx_reading_input_value_reading_acronym; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reading_input_value_reading_acronym ON public.reading_input_value USING btree (reading_id, input_acronym);


--
-- Name: idx_reading_instrument_active_date_hour; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reading_instrument_active_date_hour ON public.reading USING btree (instrument_id, active, date DESC, hour DESC);


--
-- Name: idx_reading_instrument_date; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reading_instrument_date ON public.reading USING btree (instrument_id, date DESC);


--
-- Name: idx_reading_instrument_date_hour; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reading_instrument_date_hour ON public.reading USING btree (instrument_id, date DESC, hour DESC);


--
-- Name: idx_reading_instrument_limit; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reading_instrument_limit ON public.reading USING btree (instrument_id, limit_status);


--
-- Name: idx_reading_instrument_output_active; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reading_instrument_output_active ON public.reading USING btree (instrument_id, output_id, active);


--
-- Name: idx_reading_instrument_output_date; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reading_instrument_output_date ON public.reading USING btree (instrument_id, output_id, date DESC);


--
-- Name: idx_reading_instrument_status_date; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reading_instrument_status_date ON public.reading USING btree (instrument_id, limit_status, date DESC);


--
-- Name: idx_reading_instrument_value; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reading_instrument_value ON public.reading USING btree (instrument_id, calculated_value);


--
-- Name: idx_reading_limit_status; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reading_limit_status ON public.reading USING btree (limit_status);


--
-- Name: idx_reading_output_active_date_hour; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reading_output_active_date_hour ON public.reading USING btree (output_id, active, date DESC, hour DESC);


--
-- Name: idx_reading_output_date; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reading_output_date ON public.reading USING btree (output_id, date DESC);


--
-- Name: idx_reading_output_value; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reading_output_value ON public.reading USING btree (output_id, calculated_value);


--
-- Name: idx_reading_status_date; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reading_status_date ON public.reading USING btree (limit_status, date DESC);


--
-- Name: idx_reading_user_active_date; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reading_user_active_date ON public.reading USING btree (user_id, active, date DESC);


--
-- Name: idx_reading_user_date; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reading_user_date ON public.reading USING btree (user_id, date DESC);


--
-- Name: idx_reading_user_instrument; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reading_user_instrument ON public.reading USING btree (user_id, instrument_id);


--
-- Name: idx_regulatory_dam_classification; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_regulatory_dam_classification ON public.regulatory_dam USING btree (classification_dam_id);


--
-- Name: idx_regulatory_dam_damage; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_regulatory_dam_damage ON public.regulatory_dam USING btree (potential_damage_id);


--
-- Name: idx_regulatory_dam_frame_pnsb; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_regulatory_dam_frame_pnsb ON public.regulatory_dam USING btree (frame_pnsb);


--
-- Name: idx_regulatory_dam_risk; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_regulatory_dam_risk ON public.regulatory_dam USING btree (risk_category_id);


--
-- Name: idx_regulatory_dam_security; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_regulatory_dam_security ON public.regulatory_dam USING btree (security_level_id);


--
-- Name: idx_reservoir_created_at; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reservoir_created_at ON public.reservoirs USING btree (created_at);


--
-- Name: idx_reservoir_dam_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reservoir_dam_id ON public.reservoirs USING btree (dam_id);


--
-- Name: idx_reservoir_dam_level; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reservoir_dam_level ON public.reservoirs USING btree (dam_id, level_id);


--
-- Name: idx_reservoir_level_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_reservoir_level_id ON public.reservoirs USING btree (level_id);


--
-- Name: idx_riv_reading_acronym; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_riv_reading_acronym ON public.reading_input_value USING btree (reading_id, input_acronym);


--
-- Name: idx_riv_reading_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_riv_reading_id ON public.reading_input_value USING btree (reading_id);


--
-- Name: idx_section_coords; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_section_coords ON public.section USING btree (first_vertex_latitude, first_vertex_longitude);


--
-- Name: idx_section_dam_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_section_dam_id ON public.section USING btree (dam_id);


--
-- Name: idx_section_dam_name; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_section_dam_name ON public.section USING btree (dam_id, name);


--
-- Name: idx_tabulate_assoc_date_enable; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tabulate_assoc_date_enable ON public.instrument_tabulate_association USING btree (is_date_enable);


--
-- Name: idx_tabulate_assoc_indexes; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tabulate_assoc_indexes ON public.instrument_tabulate_association USING btree (date_index, hour_index, user_index);


--
-- Name: idx_tabulate_assoc_instrument; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tabulate_assoc_instrument ON public.instrument_tabulate_association USING btree (instrument_id);


--
-- Name: idx_tabulate_assoc_pattern; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tabulate_assoc_pattern ON public.instrument_tabulate_association USING btree (pattern_id);


--
-- Name: idx_tabulate_assoc_pattern_instrument; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tabulate_assoc_pattern_instrument ON public.instrument_tabulate_association USING btree (pattern_id, instrument_id);


--
-- Name: idx_tabulate_folder_dam; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tabulate_folder_dam ON public.instrument_tabulate_pattern_folder USING btree (dam_id);


--
-- Name: idx_tabulate_folder_dam_name; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tabulate_folder_dam_name ON public.instrument_tabulate_pattern_folder USING btree (dam_id, name);


--
-- Name: idx_tabulate_folder_name; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tabulate_folder_name ON public.instrument_tabulate_pattern_folder USING btree (name);


--
-- Name: idx_tabulate_output_assoc_assoc_index; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tabulate_output_assoc_assoc_index ON public.instrument_tabulate_output_association USING btree (association_id, output_index);


--
-- Name: idx_tabulate_output_assoc_assoc_output; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tabulate_output_assoc_assoc_output ON public.instrument_tabulate_output_association USING btree (association_id, output_id);


--
-- Name: idx_tabulate_output_assoc_association; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tabulate_output_assoc_association ON public.instrument_tabulate_output_association USING btree (association_id);


--
-- Name: idx_tabulate_output_assoc_index; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tabulate_output_assoc_index ON public.instrument_tabulate_output_association USING btree (output_index);


--
-- Name: idx_tabulate_output_assoc_output; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tabulate_output_assoc_output ON public.instrument_tabulate_output_association USING btree (output_id);


--
-- Name: idx_tabulate_pattern_dam; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tabulate_pattern_dam ON public.instrument_tabulate_pattern USING btree (dam_id);


--
-- Name: idx_tabulate_pattern_dam_name; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tabulate_pattern_dam_name ON public.instrument_tabulate_pattern USING btree (dam_id, name);


--
-- Name: idx_tabulate_pattern_folder; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tabulate_pattern_folder ON public.instrument_tabulate_pattern USING btree (folder_id);


--
-- Name: idx_tabulate_pattern_folder_name; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tabulate_pattern_folder_name ON public.instrument_tabulate_pattern USING btree (folder_id, name);


--
-- Name: idx_tabulate_pattern_name; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tabulate_pattern_name ON public.instrument_tabulate_pattern USING btree (name);


--
-- Name: idx_template_questionnaire_name; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_template_questionnaire_name ON public.template_questionnaires USING btree (name);


--
-- Name: idx_tqq_order; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tqq_order ON public.template_questionnaire_questions USING btree (template_questionnaire_id, order_index);


--
-- Name: idx_tqq_question_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tqq_question_id ON public.template_questionnaire_questions USING btree (question_id);


--
-- Name: idx_tqq_template_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tqq_template_id ON public.template_questionnaire_questions USING btree (template_questionnaire_id);


--
-- Name: section fk1ingyhfvqmwr31efjc81mwkew; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.section
    ADD CONSTRAINT fk1ingyhfvqmwr31efjc81mwkew FOREIGN KEY (dam_id) REFERENCES public.dam(id);


--
-- Name: dam fk1msr5e0iyphyifdwrp39ff34o; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dam
    ADD CONSTRAINT fk1msr5e0iyphyifdwrp39ff34o FOREIGN KEY (status_id) REFERENCES public.status(id);


--
-- Name: anomaly_photos fk1t30oqndwrg68os1teh3yyalx; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.anomaly_photos
    ADD CONSTRAINT fk1t30oqndwrg68os1teh3yyalx FOREIGN KEY (anomaly_id) REFERENCES public.anomalies(id);


--
-- Name: deterministic_limit fk219qt88q8hbcffvk14k6l7elm; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.deterministic_limit
    ADD CONSTRAINT fk219qt88q8hbcffvk14k6l7elm FOREIGN KEY (output_id) REFERENCES public.output(id);


--
-- Name: regulatory_dam fk2mi3chlukksvxgxbfv791yehv; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.regulatory_dam
    ADD CONSTRAINT fk2mi3chlukksvxgxbfv791yehv FOREIGN KEY (risk_category_id) REFERENCES public.risk_categories(id);


--
-- Name: instrument_graph_pattern fk3dxbyv4kc911wh483o063c4wy; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_graph_pattern
    ADD CONSTRAINT fk3dxbyv4kc911wh483o063c4wy FOREIGN KEY (folder_id) REFERENCES public.instrument_graph_pattern_folder(id);


--
-- Name: checklist_template_questionnaire fk3ea1ejhkfasyc2fu5rnl3dylx; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.checklist_template_questionnaire
    ADD CONSTRAINT fk3ea1ejhkfasyc2fu5rnl3dylx FOREIGN KEY (template_questionnaire_id) REFERENCES public.template_questionnaires(id);


--
-- Name: answers fk3erw1a3t0r78st8ty27x6v3g1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.answers
    ADD CONSTRAINT fk3erw1a3t0r78st8ty27x6v3g1 FOREIGN KEY (question_id) REFERENCES public.questions(id);


--
-- Name: instrument_tabulate_association fk3p5aajn6h4c1bk7jj0n63p4by; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_tabulate_association
    ADD CONSTRAINT fk3p5aajn6h4c1bk7jj0n63p4by FOREIGN KEY (pattern_id) REFERENCES public.instrument_tabulate_pattern(id);


--
-- Name: instrument fk4b2cj4h5oiu5tklh8g2dueukg; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument
    ADD CONSTRAINT fk4b2cj4h5oiu5tklh8g2dueukg FOREIGN KEY (dam_id) REFERENCES public.dam(id);


--
-- Name: instrument fk4fmhfxqelvk6ahs32cbxcr7l8; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument
    ADD CONSTRAINT fk4fmhfxqelvk6ahs32cbxcr7l8 FOREIGN KEY (instrument_type_id) REFERENCES public.instrument_type(id);


--
-- Name: routine_inspection_permissions fk5bns02b7bm8t3xpb20kej8x5w; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.routine_inspection_permissions
    ADD CONSTRAINT fk5bns02b7bm8t3xpb20kej8x5w FOREIGN KEY (user_id) REFERENCES public.users(id);


--
-- Name: instrument_tabulate_pattern fk65eu9mf2rje5svbhwpcckknp4; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_tabulate_pattern
    ADD CONSTRAINT fk65eu9mf2rje5svbhwpcckknp4 FOREIGN KEY (folder_id) REFERENCES public.instrument_tabulate_pattern_folder(id);


--
-- Name: user_client fk6807u45jdkwmp2kt9vmyrjrlr; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.user_client
    ADD CONSTRAINT fk6807u45jdkwmp2kt9vmyrjrlr FOREIGN KEY (client_id) REFERENCES public.client(id);


--
-- Name: dam_permissions fk6hhpo5kbs452dyo5scmjitu5c; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dam_permissions
    ADD CONSTRAINT fk6hhpo5kbs452dyo5scmjitu5c FOREIGN KEY (created_by) REFERENCES public.users(id);


--
-- Name: instrument_graph_customization_properties fk6luowbaps30yigflr6qmdmfs5; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_graph_customization_properties
    ADD CONSTRAINT fk6luowbaps30yigflr6qmdmfs5 FOREIGN KEY (constant_id) REFERENCES public.constant(id);


--
-- Name: instrument_graph_customization_properties fk8p8i6qdeq6d81g4b0pv6srgqr; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_graph_customization_properties
    ADD CONSTRAINT fk8p8i6qdeq6d81g4b0pv6srgqr FOREIGN KEY (deterministic_limit_id) REFERENCES public.deterministic_limit(id);


--
-- Name: instrument_tabulate_pattern fk8pq1ejkqxbfd12jk4lgbbrbg9; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_tabulate_pattern
    ADD CONSTRAINT fk8pq1ejkqxbfd12jk4lgbbrbg9 FOREIGN KEY (dam_id) REFERENCES public.dam(id);


--
-- Name: instrument fk935d40dshf9s321kpngawhnx9; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument
    ADD CONSTRAINT fk935d40dshf9s321kpngawhnx9 FOREIGN KEY (section_id) REFERENCES public.section(id);


--
-- Name: constant fk99yik34r84cmesqdvu2q9qetk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.constant
    ADD CONSTRAINT fk99yik34r84cmesqdvu2q9qetk FOREIGN KEY (instrument_id) REFERENCES public.instrument(id);


--
-- Name: answers fk9efww7kc8ubw3bq257gkkdu2s; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.answers
    ADD CONSTRAINT fk9efww7kc8ubw3bq257gkkdu2s FOREIGN KEY (questionnaire_response_id) REFERENCES public.questionnaire_responses(id);


--
-- Name: answer_options fk9hu9eir3fpbcbq83yxmqo0roh; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.answer_options
    ADD CONSTRAINT fk9hu9eir3fpbcbq83yxmqo0roh FOREIGN KEY (answer_id) REFERENCES public.answers(id);


--
-- Name: question_option fk9urqaptr64qt7ov7xwy48r4tj; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.question_option
    ADD CONSTRAINT fk9urqaptr64qt7ov7xwy48r4tj FOREIGN KEY (option_id) REFERENCES public.options(id);


--
-- Name: psb_files fk9x526xeynpci58b3pgpq7qf0q; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.psb_files
    ADD CONSTRAINT fk9x526xeynpci58b3pgpq7qf0q FOREIGN KEY (psb_folder_id) REFERENCES public.psb_folders(id);


--
-- Name: checklists fk_checklist_dam; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.checklists
    ADD CONSTRAINT fk_checklist_dam FOREIGN KEY (dam_id) REFERENCES public.dam(id) ON DELETE CASCADE;


--
-- Name: reading_input_value fk_reading_input_value_reading; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.reading_input_value
    ADD CONSTRAINT fk_reading_input_value_reading FOREIGN KEY (reading_id) REFERENCES public.reading(id) ON DELETE CASCADE;


--
-- Name: attributions_permissions fka1q3jt8gie13q8g6x5vl8v6i1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.attributions_permissions
    ADD CONSTRAINT fka1q3jt8gie13q8g6x5vl8v6i1 FOREIGN KEY (user_id) REFERENCES public.users(id);


--
-- Name: regulatory_dam fka4o8htiy7d1bienbnkdur6a9w; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.regulatory_dam
    ADD CONSTRAINT fka4o8htiy7d1bienbnkdur6a9w FOREIGN KEY (classification_dam_id) REFERENCES public.classification_dams(id);


--
-- Name: verification_codes fka4qo6nts1xd94owirq5evcpda; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.verification_codes
    ADD CONSTRAINT fka4qo6nts1xd94owirq5evcpda FOREIGN KEY (user_id) REFERENCES public.users(id);


--
-- Name: regulatory_dam fkagy72maxkjj0vxnev6rdg3cfu; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.regulatory_dam
    ADD CONSTRAINT fkagy72maxkjj0vxnev6rdg3cfu FOREIGN KEY (security_level_id) REFERENCES public.security_levels(id);


--
-- Name: reservoirs fkbc2c4pcvnac8d6fubga8lh8xw; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.reservoirs
    ADD CONSTRAINT fkbc2c4pcvnac8d6fubga8lh8xw FOREIGN KEY (level_id) REFERENCES public.levels(id);


--
-- Name: template_questionnaire_questions fkcin7o3soc5tchrp20k1745uv8; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.template_questionnaire_questions
    ADD CONSTRAINT fkcin7o3soc5tchrp20k1745uv8 FOREIGN KEY (template_questionnaire_id) REFERENCES public.template_questionnaires(id);


--
-- Name: instrument_graph_axes fkd93iv145rlitv9si9blo8ld0u; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_graph_axes
    ADD CONSTRAINT fkd93iv145rlitv9si9blo8ld0u FOREIGN KEY (pattern_id) REFERENCES public.instrument_graph_pattern(id);


--
-- Name: dam_permissions fkdss7rlsfpu1nygiwqu5gr0our; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dam_permissions
    ADD CONSTRAINT fkdss7rlsfpu1nygiwqu5gr0our FOREIGN KEY (updated_by) REFERENCES public.users(id);


--
-- Name: anomalies fke554m1il2p7t2whhsqj6nelsv; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.anomalies
    ADD CONSTRAINT fke554m1il2p7t2whhsqj6nelsv FOREIGN KEY (status_id) REFERENCES public.anomaly_status(id);


--
-- Name: instrument_graph_pattern fkeswjn3m57don33y5otqflpg19; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_graph_pattern
    ADD CONSTRAINT fkeswjn3m57don33y5otqflpg19 FOREIGN KEY (instrument_id) REFERENCES public.instrument(id);


--
-- Name: reading fkfpo47ycjqw04b7sfq5orgyxea; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.reading
    ADD CONSTRAINT fkfpo47ycjqw04b7sfq5orgyxea FOREIGN KEY (instrument_id) REFERENCES public.instrument(id);


--
-- Name: anomalies fkgcpc164oygiguoa08967r55ow; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.anomalies
    ADD CONSTRAINT fkgcpc164oygiguoa08967r55ow FOREIGN KEY (danger_level_id) REFERENCES public.danger_levels(id);


--
-- Name: psb_folders fkgjub42w8kaecvnt6i73yweshp; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.psb_folders
    ADD CONSTRAINT fkgjub42w8kaecvnt6i73yweshp FOREIGN KEY (dam_id) REFERENCES public.dam(id);


--
-- Name: documentation_dam fkgpcxiem741mcp2qygg37cld86; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.documentation_dam
    ADD CONSTRAINT fkgpcxiem741mcp2qygg37cld86 FOREIGN KEY (dam_id) REFERENCES public.dam(id);


--
-- Name: documentation_permissions fkgwi3t8vcf4c2l8rcfbcebyy8e; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.documentation_permissions
    ADD CONSTRAINT fkgwi3t8vcf4c2l8rcfbcebyy8e FOREIGN KEY (user_id) REFERENCES public.users(id);


--
-- Name: checklist_template_questionnaire fkh834fdiv212fsnxdgkbpsoqo1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.checklist_template_questionnaire
    ADD CONSTRAINT fkh834fdiv212fsnxdgkbpsoqo1 FOREIGN KEY (checklist_id) REFERENCES public.checklists(id);


--
-- Name: anomalies fkhig0kyy20prba25f7akn0hrly; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.anomalies
    ADD CONSTRAINT fkhig0kyy20prba25f7akn0hrly FOREIGN KEY (user_id) REFERENCES public.users(id);


--
-- Name: dam_permissions fkhyg3mf5ugawo240w1872q8g4w; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dam_permissions
    ADD CONSTRAINT fkhyg3mf5ugawo240w1872q8g4w FOREIGN KEY (client_id) REFERENCES public.client(id);


--
-- Name: input fki1tcwk1kufv61nmmdobvmg32a; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.input
    ADD CONSTRAINT fki1tcwk1kufv61nmmdobvmg32a FOREIGN KEY (instrument_id) REFERENCES public.instrument(id);


--
-- Name: dam fkidd4mv5rt7qs9draouxva9hvy; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dam
    ADD CONSTRAINT fkidd4mv5rt7qs9draouxva9hvy FOREIGN KEY (client_id) REFERENCES public.client(id);


--
-- Name: anomalies fkieyax3pfwm94tfy8sh47dok4x; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.anomalies
    ADD CONSTRAINT fkieyax3pfwm94tfy8sh47dok4x FOREIGN KEY (dam_id) REFERENCES public.dam(id);


--
-- Name: template_questionnaire_questions fkihluxspmetksbca0k73d6t1p8; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.template_questionnaire_questions
    ADD CONSTRAINT fkihluxspmetksbca0k73d6t1p8 FOREIGN KEY (question_id) REFERENCES public.questions(id);


--
-- Name: instrument_tabulate_pattern_folder fkilevxedkf4bsx7h4lh5p58g6i; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_tabulate_pattern_folder
    ADD CONSTRAINT fkilevxedkf4bsx7h4lh5p58g6i FOREIGN KEY (dam_id) REFERENCES public.dam(id);


--
-- Name: psb_files fkk3a59tdkho4k3ojdsm6meed7g; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.psb_files
    ADD CONSTRAINT fkk3a59tdkho4k3ojdsm6meed7g FOREIGN KEY (uploaded_by_id) REFERENCES public.users(id);


--
-- Name: instrument_tabulate_output_association fkk4jpb4qq20vgjvd5qrrsv610p; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_tabulate_output_association
    ADD CONSTRAINT fkk4jpb4qq20vgjvd5qrrsv610p FOREIGN KEY (association_id) REFERENCES public.instrument_tabulate_association(id);


--
-- Name: answer_photos fkkgnj01ehuqlcv02pneatbb2he; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.answer_photos
    ADD CONSTRAINT fkkgnj01ehuqlcv02pneatbb2he FOREIGN KEY (answer_id) REFERENCES public.answers(id);


--
-- Name: output fkki57pt6qbainvh3fusvqyn7ol; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.output
    ADD CONSTRAINT fkki57pt6qbainvh3fusvqyn7ol FOREIGN KEY (measurement_unit_id) REFERENCES public.measurement_unit(id);


--
-- Name: dam_permissions fkksjft6poa1th6qtkhwielk8d; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dam_permissions
    ADD CONSTRAINT fkksjft6poa1th6qtkhwielk8d FOREIGN KEY (dam_id) REFERENCES public.dam(id);


--
-- Name: questionnaire_responses fkkteogsw77qxowioobje7q4m0g; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.questionnaire_responses
    ADD CONSTRAINT fkkteogsw77qxowioobje7q4m0g FOREIGN KEY (checklist_response_id) REFERENCES public.checklist_responses(id);


--
-- Name: instrument_graph_customization_properties fkloth1r4e67815sd1m1j51a2ex; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_graph_customization_properties
    ADD CONSTRAINT fkloth1r4e67815sd1m1j51a2ex FOREIGN KEY (output_id) REFERENCES public.output(id);


--
-- Name: reservoirs fkm7q46mxgk36ely5nhy34hacip; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.reservoirs
    ADD CONSTRAINT fkm7q46mxgk36ely5nhy34hacip FOREIGN KEY (dam_id) REFERENCES public.dam(id);


--
-- Name: dam_permissions fkmonsrspiqcprcfm64r19p4tvh; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dam_permissions
    ADD CONSTRAINT fkmonsrspiqcprcfm64r19p4tvh FOREIGN KEY (user_id) REFERENCES public.users(id);


--
-- Name: psb_folders fkmuh52yd8j6y0wa4hn73hu4fw8; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.psb_folders
    ADD CONSTRAINT fkmuh52yd8j6y0wa4hn73hu4fw8 FOREIGN KEY (created_by) REFERENCES public.users(id);


--
-- Name: instrument_graph_pattern_folder fknapmyym478oqqp0xhxnpfks9f; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_graph_pattern_folder
    ADD CONSTRAINT fknapmyym478oqqp0xhxnpfks9f FOREIGN KEY (dam_id) REFERENCES public.dam(id);


--
-- Name: instrument_tabulate_output_association fknhwyt106cl4oiwoot8cqf0hfc; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_tabulate_output_association
    ADD CONSTRAINT fknhwyt106cl4oiwoot8cqf0hfc FOREIGN KEY (output_id) REFERENCES public.output(id);


--
-- Name: questionnaire_responses fknxtwj02i34cuu16ncrp8a1lki; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.questionnaire_responses
    ADD CONSTRAINT fknxtwj02i34cuu16ncrp8a1lki FOREIGN KEY (dam_id) REFERENCES public.dam(id);


--
-- Name: instrument_graph_customization_properties fknysastmuw36781ea4e9ct5mis; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_graph_customization_properties
    ADD CONSTRAINT fknysastmuw36781ea4e9ct5mis FOREIGN KEY (pattern_id) REFERENCES public.instrument_graph_pattern(id);


--
-- Name: input fko3d2nchjf132m4l1inu43qn66; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.input
    ADD CONSTRAINT fko3d2nchjf132m4l1inu43qn66 FOREIGN KEY (measurement_unit_id) REFERENCES public.measurement_unit(id);


--
-- Name: checklist_responses fkoef60bxqq0drq2774f3830l1y; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.checklist_responses
    ADD CONSTRAINT fkoef60bxqq0drq2774f3830l1y FOREIGN KEY (dam_id) REFERENCES public.dam(id);


--
-- Name: reading fkoppc92hyryv2ivimm2p4plmt5; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.reading
    ADD CONSTRAINT fkoppc92hyryv2ivimm2p4plmt5 FOREIGN KEY (output_id) REFERENCES public.output(id);


--
-- Name: regulatory_dam fkossrdiw536mi3b2qkxls4fh8; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.regulatory_dam
    ADD CONSTRAINT fkossrdiw536mi3b2qkxls4fh8 FOREIGN KEY (dam_id) REFERENCES public.dam(id);


--
-- Name: user_client fkp2w0osnr6w40nxd56qnwvpk0w; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.user_client
    ADD CONSTRAINT fkp2w0osnr6w40nxd56qnwvpk0w FOREIGN KEY (user_id) REFERENCES public.users(id);


--
-- Name: instrument_graph_customization_properties fkp3w2m7adajlpl3pms96fqhrph; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_graph_customization_properties
    ADD CONSTRAINT fkp3w2m7adajlpl3pms96fqhrph FOREIGN KEY (statistical_limit_id) REFERENCES public.statistical_limit(id);


--
-- Name: answer_options fkpaub45j3djvy5md5yph6qhv0o; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.answer_options
    ADD CONSTRAINT fkpaub45j3djvy5md5yph6qhv0o FOREIGN KEY (option_id) REFERENCES public.options(id);


--
-- Name: client fkpc4nxaf4m9semynspoxq8cmu6; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.client
    ADD CONSTRAINT fkpc4nxaf4m9semynspoxq8cmu6 FOREIGN KEY (status_id) REFERENCES public.status(id);


--
-- Name: instrument_tabulate_association fkpt755rkg8eb6ffm1cipn7rnnh; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_tabulate_association
    ADD CONSTRAINT fkpt755rkg8eb6ffm1cipn7rnnh FOREIGN KEY (instrument_id) REFERENCES public.instrument(id);


--
-- Name: statistical_limit fkpym3faf4o2kuwk1myfwcjj7li; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.statistical_limit
    ADD CONSTRAINT fkpym3faf4o2kuwk1myfwcjj7li FOREIGN KEY (output_id) REFERENCES public.output(id);


--
-- Name: regulatory_dam fkpym4qomp4k3x8hj43ofrfei4g; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.regulatory_dam
    ADD CONSTRAINT fkpym4qomp4k3x8hj43ofrfei4g FOREIGN KEY (potential_damage_id) REFERENCES public.potential_damages(id);


--
-- Name: instrument_graph_customization_properties fkq5xp8l0jc14pqesmq10p9s3rc; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrument_graph_customization_properties
    ADD CONSTRAINT fkq5xp8l0jc14pqesmq10p9s3rc FOREIGN KEY (instrument_id) REFERENCES public.instrument(id);


--
-- Name: checklist_responses fkrljl7a4kngcrwf0hb3bctmhe8; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.checklist_responses
    ADD CONSTRAINT fkrljl7a4kngcrwf0hb3bctmhe8 FOREIGN KEY (user_id) REFERENCES public.users(id);


--
-- Name: psb_folders fkrnr0xb37rte7krea1iebu9j1f; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.psb_folders
    ADD CONSTRAINT fkrnr0xb37rte7krea1iebu9j1f FOREIGN KEY (parent_folder_id) REFERENCES public.psb_folders(id);


--
-- Name: questionnaire_responses fkrv3dbxrvv5a2iy1qd6br70yfw; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.questionnaire_responses
    ADD CONSTRAINT fkrv3dbxrvv5a2iy1qd6br70yfw FOREIGN KEY (template_questionnaire_id) REFERENCES public.template_questionnaires(id);


--
-- Name: output fksfarayn6inor5wgkgnmvvc6bu; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.output
    ADD CONSTRAINT fksfarayn6inor5wgkgnmvvc6bu FOREIGN KEY (instrument_id) REFERENCES public.instrument(id);


--
-- Name: reading fksx4v17uurq04w131i88jq9vhd; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.reading
    ADD CONSTRAINT fksx4v17uurq04w131i88jq9vhd FOREIGN KEY (user_id) REFERENCES public.users(id);


--
-- Name: instrumentation_permissions fkt7k1ipsfbnq6360k13bha1lso; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.instrumentation_permissions
    ADD CONSTRAINT fkt7k1ipsfbnq6360k13bha1lso FOREIGN KEY (user_id) REFERENCES public.users(id);


--
-- Name: constant fktqq0e890ncxphsabkucty5n5p; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.constant
    ADD CONSTRAINT fktqq0e890ncxphsabkucty5n5p FOREIGN KEY (measurement_unit_id) REFERENCES public.measurement_unit(id);


--
-- Name: question_option fktrf5invxsty5o99qqlrkgjwkh; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.question_option
    ADD CONSTRAINT fktrf5invxsty5o99qqlrkgjwkh FOREIGN KEY (question_id) REFERENCES public.questions(id);