+-- Name: oauth_access_grants_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE public.oauth_access_grants_id_seq OWNED BY public.oauth_access_grants.id;
+
+
+--
+-- Name: oauth_access_tokens; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.oauth_access_tokens (
+ id bigint NOT NULL,
+ resource_owner_id bigint,
+ application_id bigint NOT NULL,
+ token character varying NOT NULL,
+ refresh_token character varying,
+ expires_in integer,
+ revoked_at timestamp without time zone,
+ created_at timestamp without time zone NOT NULL,
+ scopes character varying,
+ previous_refresh_token character varying DEFAULT ''::character varying NOT NULL
+);
+
+
+--
+-- Name: oauth_access_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE public.oauth_access_tokens_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: oauth_access_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE public.oauth_access_tokens_id_seq OWNED BY public.oauth_access_tokens.id;
+
+
+--
+-- Name: oauth_applications; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.oauth_applications (
+ id bigint NOT NULL,
+ owner_type character varying NOT NULL,
+ owner_id bigint NOT NULL,
+ name character varying NOT NULL,
+ uid character varying NOT NULL,
+ secret character varying NOT NULL,
+ redirect_uri text NOT NULL,
+ scopes character varying DEFAULT ''::character varying NOT NULL,
+ confidential boolean DEFAULT true NOT NULL,
+ created_at timestamp(6) without time zone NOT NULL,
+ updated_at timestamp(6) without time zone NOT NULL
+);
+
+
+--
+-- Name: oauth_applications_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE public.oauth_applications_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: oauth_applications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE public.oauth_applications_id_seq OWNED BY public.oauth_applications.id;
+
+
+--
+-- Name: oauth_openid_requests; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.oauth_openid_requests (
+ id bigint NOT NULL,
+ access_grant_id bigint NOT NULL,
+ nonce character varying NOT NULL
+);
+
+
+--
+-- Name: oauth_openid_requests_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE public.oauth_openid_requests_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: oauth_openid_requests_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE public.oauth_openid_requests_id_seq OWNED BY public.oauth_openid_requests.id;
+
+
+--
+-- Name: redactions; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.redactions (
+ id integer NOT NULL,
+ title character varying NOT NULL,
+ description text NOT NULL,
+ created_at timestamp without time zone,
+ updated_at timestamp without time zone,
+ user_id bigint NOT NULL,
+ description_format public.format_enum DEFAULT 'markdown'::public.format_enum NOT NULL
+);
+
+
+--
+-- Name: redactions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE public.redactions_id_seq
+ AS integer
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: redactions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE public.redactions_id_seq OWNED BY public.redactions.id;
+
+
+--
+-- Name: relation_members; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.relation_members (
+ relation_id bigint NOT NULL,
+ member_type public.nwr_enum NOT NULL,
+ member_id bigint NOT NULL,
+ member_role character varying NOT NULL,
+ version bigint DEFAULT 0 NOT NULL,
+ sequence_id integer DEFAULT 0 NOT NULL
+);
+
+
+--
+-- Name: relation_tags; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.relation_tags (
+ relation_id bigint NOT NULL,
+ k character varying DEFAULT ''::character varying NOT NULL,
+ v character varying DEFAULT ''::character varying NOT NULL,
+ version bigint NOT NULL
+);
+
+
+--
+-- Name: relations; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.relations (
+ relation_id bigint NOT NULL,
+ changeset_id bigint NOT NULL,
+ "timestamp" timestamp without time zone NOT NULL,
+ version bigint NOT NULL,
+ visible boolean DEFAULT true NOT NULL,
+ redaction_id integer
+);
+
+
+--
+-- Name: reports; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.reports (
+ id integer NOT NULL,
+ issue_id integer NOT NULL,
+ user_id integer NOT NULL,
+ details text NOT NULL,
+ category character varying NOT NULL,
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
+);
+
+
+--
+-- Name: reports_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE public.reports_id_seq
+ AS integer
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: reports_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE public.reports_id_seq OWNED BY public.reports.id;
+
+
+--
+-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.schema_migrations (
+ version character varying NOT NULL
+);
+
+
+--
+-- Name: user_blocks; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.user_blocks (
+ id integer NOT NULL,
+ user_id bigint NOT NULL,
+ creator_id bigint NOT NULL,
+ reason text NOT NULL,
+ ends_at timestamp without time zone NOT NULL,
+ needs_view boolean DEFAULT false NOT NULL,
+ revoker_id bigint,
+ created_at timestamp without time zone,
+ updated_at timestamp without time zone,
+ reason_format public.format_enum DEFAULT 'markdown'::public.format_enum NOT NULL,
+ deactivates_at timestamp without time zone
+);
+
+
+--
+-- Name: user_blocks_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE public.user_blocks_id_seq
+ AS integer
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: user_blocks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE public.user_blocks_id_seq OWNED BY public.user_blocks.id;
+
+
+--
+-- Name: user_mutes; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.user_mutes (
+ id bigint NOT NULL,
+ owner_id bigint NOT NULL,
+ subject_id bigint NOT NULL,
+ created_at timestamp(6) without time zone NOT NULL,
+ updated_at timestamp(6) without time zone NOT NULL
+);
+
+
+--
+-- Name: user_mutes_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE public.user_mutes_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: user_mutes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE public.user_mutes_id_seq OWNED BY public.user_mutes.id;
+
+
+--
+-- Name: user_preferences; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.user_preferences (
+ user_id bigint NOT NULL,
+ k character varying NOT NULL,
+ v character varying NOT NULL
+);
+
+
+--
+-- Name: user_roles; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.user_roles (
+ id integer NOT NULL,
+ user_id bigint NOT NULL,
+ role public.user_role_enum NOT NULL,
+ created_at timestamp without time zone,
+ updated_at timestamp without time zone,
+ granter_id bigint NOT NULL
+);
+
+
+--
+-- Name: user_roles_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE public.user_roles_id_seq
+ AS integer
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: user_roles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE public.user_roles_id_seq OWNED BY public.user_roles.id;
+
+
+--
+-- Name: users; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.users (
+ email character varying NOT NULL,
+ id bigint NOT NULL,
+ pass_crypt character varying NOT NULL,
+ creation_time timestamp without time zone NOT NULL,
+ display_name character varying DEFAULT ''::character varying NOT NULL,
+ data_public boolean DEFAULT false NOT NULL,
+ description text DEFAULT ''::text NOT NULL,
+ home_lat double precision,
+ home_lon double precision,
+ home_zoom smallint DEFAULT 3,
+ pass_salt character varying,
+ email_valid boolean DEFAULT false NOT NULL,
+ new_email character varying,
+ creation_ip character varying,
+ languages character varying,
+ status public.user_status_enum DEFAULT 'pending'::public.user_status_enum NOT NULL,
+ terms_agreed timestamp without time zone,
+ consider_pd boolean DEFAULT false NOT NULL,
+ auth_uid character varying,
+ preferred_editor character varying,
+ terms_seen boolean DEFAULT false NOT NULL,
+ description_format public.format_enum DEFAULT 'markdown'::public.format_enum NOT NULL,
+ changesets_count integer DEFAULT 0 NOT NULL,
+ traces_count integer DEFAULT 0 NOT NULL,
+ diary_entries_count integer DEFAULT 0 NOT NULL,
+ image_use_gravatar boolean DEFAULT false NOT NULL,
+ auth_provider character varying,
+ home_tile bigint,
+ tou_agreed timestamp without time zone,
+ diary_comments_count integer DEFAULT 0,
+ note_comments_count integer DEFAULT 0
+);
+
+
+--
+-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE public.users_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;
+
+
+--
+-- Name: way_nodes; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.way_nodes (
+ way_id bigint NOT NULL,
+ node_id bigint NOT NULL,
+ version bigint NOT NULL,
+ sequence_id bigint NOT NULL
+);
+
+
+--
+-- Name: way_tags; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.way_tags (
+ way_id bigint NOT NULL,
+ k character varying NOT NULL,
+ v character varying NOT NULL,
+ version bigint NOT NULL
+);
+
+
+--
+-- Name: ways; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.ways (
+ way_id bigint NOT NULL,
+ changeset_id bigint NOT NULL,
+ "timestamp" timestamp without time zone NOT NULL,
+ version bigint NOT NULL,
+ visible boolean DEFAULT true NOT NULL,
+ redaction_id integer
+);
+
+
+--
+-- Name: acls id; Type: DEFAULT; Schema: public; Owner: -