text: SET statement_timeout = 0;
  SET lock_timeout = 0;
  SET idle_in_transaction_session_timeout = 0;
  SET client_encoding = 'UTF8';
  SET standard_conforming_strings = on;
  SELECT pg_catalog.set_config('search_path', '', false);
  SET check_function_bodies = false;
  SET xmloption = content;
  SET client_min_messages = warning;
  SET row_security = off;
  
  --
  -- Name: units_of_measurement; Type: TYPE; Schema: public; Owner: -
  --
  
  CREATE TYPE public.units_of_measurement AS ENUM (
      'si',
      'us'
  );
  
  
  SET default_tablespace = '';
  
  SET default_table_access_method = heap;
  
  --
  -- Name: ar_internal_metadata; Type: TABLE; Schema: public; Owner: -
  --
  
  CREATE TABLE public.ar_internal_metadata (
      key character varying NOT NULL,
      value character varying,
      created_at timestamp(6) without time zone NOT NULL,
      updated_at timestamp(6) without time zone NOT NULL
  );
  
  
  --
  -- Name: forecasts; Type: TABLE; Schema: public; Owner: -
  --
  
  CREATE TABLE public.forecasts (
      id bigint NOT NULL,
      location_id bigint NOT NULL,
      data json,
      created_at timestamp(6) without time zone NOT NULL,
      updated_at timestamp(6) without time zone NOT NULL,
      units public.units_of_measurement,
      data_timestamp timestamp without time zone
  );
  
  
  --
  -- Name: forecasts_id_seq; Type: SEQUENCE; Schema: public; Owner: -
  --
  
  CREATE SEQUENCE public.forecasts_id_seq
      START WITH 1
      INCREMENT BY 1
      NO MINVALUE
      NO MAXVALUE
      CACHE 1;
  
  
  --
  -- Name: forecasts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
  --
  
  ALTER SEQUENCE public.forecasts_id_seq OWNED BY public.forecasts.id;
  
  
  --
  -- Name: locations; Type: TABLE; Schema: public; Owner: -
  --
  
  CREATE TABLE public.locations (
      id bigint NOT NULL,
      latitude numeric,
      longitude numeric,
      created_at timestamp(6) without time zone NOT NULL,
      updated_at timestamp(6) without time zone NOT NULL
  );
  
  
  --
  -- Name: locations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
  --
  
  CREATE SEQUENCE public.locations_id_seq
      START WITH 1
      INCREMENT BY 1
      NO MINVALUE
      NO MAXVALUE
      CACHE 1;
  
  
  --
  -- Name: locations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
  --
  
  ALTER SEQUENCE public.locations_id_seq OWNED BY public.locations.id;
  
  
  --
  -- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -
  --
  
  CREATE TABLE public.schema_migrations (
      version character varying NOT NULL
  );
  
  
  --
  -- Name: forecasts id; Type: DEFAULT; Schema: public; Owner: -
  --
  
  ALTER TABLE ONLY public.forecasts ALTER COLUMN id SET DEFAULT nextval('public.forecasts_id_seq'::regclass);
  
  
  --
  -- Name: locations id; Type: DEFAULT; Schema: public; Owner: -
  --
  
  ALTER TABLE ONLY public.locations ALTER COLUMN id SET DEFAULT nextval('public.locations_id_seq'::regclass);
  
  
  --
  -- Name: ar_internal_metadata ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: -
  --
  
  ALTER TABLE ONLY public.ar_internal_metadata
      ADD CONSTRAINT ar_internal_metadata_pkey PRIMARY KEY (key);
  
  
  --
  -- Name: forecasts forecasts_pkey; Type: CONSTRAINT; Schema: public; Owner: -
  --
  
  ALTER TABLE ONLY public.forecasts
      ADD CONSTRAINT forecasts_pkey PRIMARY KEY (id);
  
  
  --
  -- Name: locations locations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
  --
  
  ALTER TABLE ONLY public.locations
      ADD CONSTRAINT locations_pkey PRIMARY KEY (id);
  
  
  --
  -- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
  --
  
  ALTER TABLE ONLY public.schema_migrations
      ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version);
  
  
  --
  -- Name: index_forecasts_on_location_id; Type: INDEX; Schema: public; Owner: -
  --
  
  CREATE INDEX index_forecasts_on_location_id ON public.forecasts USING btree (location_id);
  
  
  --
  -- Name: index_forecasts_on_units; Type: INDEX; Schema: public; Owner: -
  --
  
  CREATE INDEX index_forecasts_on_units ON public.forecasts USING btree (units);
  
  
  --
  -- Name: index_locations_on_latitude_and_longitude; Type: INDEX; Schema: public; Owner: -
  --
  
  CREATE UNIQUE INDEX index_locations_on_latitude_and_longitude ON public.locations USING btree (latitude, longitude);
  
  
  --
  -- Name: forecasts fk_rails_6aed6f4045; Type: FK CONSTRAINT; Schema: public; Owner: -
  --
  
  ALTER TABLE ONLY public.forecasts
      ADD CONSTRAINT fk_rails_6aed6f4045 FOREIGN KEY (location_id) REFERENCES public.locations(id);
  
  
  --
  -- PostgreSQL database dump complete
  --
  
  SET search_path TO "$user", public;
  
  INSERT INTO "schema_migrations" (version) VALUES
  ('20210318131326'),
  ('20210318144449'),
  ('20210428173114');
  
  
  