 
 
 --
--- Name: monthly_new_users; Type: VIEW; Schema: public; Owner: -
---
-
-CREATE VIEW monthly_new_users AS
- SELECT count(*) AS count,
-    c.name AS community,
-    (date_trunc('month'::text, u.created_at))::date AS month
-   FROM users u,
-    users_community uc,
-    community c
-  WHERE ((u.id = uc.user_id) AND (uc.community_id = c.id))
-  GROUP BY c.name, (date_trunc('month'::text, u.created_at))::date
-  ORDER BY (date_trunc('month'::text, u.created_at))::date DESC, count(*) DESC;
-
-
---
--- Name: networks; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-CREATE TABLE networks (
-    id integer NOT NULL,
-    name character varying(255),
-    description text,
-    avatar_url character varying(255),
-    banner_url character varying(255),
-    slug character varying(255),
-    created_at timestamp with time zone,
-    updated_at timestamp with time zone
-);
-
-
---
--- Name: networks_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE networks_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: networks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE networks_id_seq OWNED BY networks.id;
-
-
---
--- Name: notification_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE notification_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: notification_status_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE notification_status_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: notifications; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-CREATE TABLE notifications (
-    id integer NOT NULL,
-    activity_id bigint,
-    sent_at timestamp with time zone,
-    created_at timestamp with time zone,
-    updated_at timestamp with time zone,
-    medium character varying(255)
-);
-
-
---
--- Name: notifications_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE notifications_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: notifications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE notifications_id_seq OWNED BY notifications.id;
-
-
---
--- Name: org_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE org_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: post_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE post_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: post; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-CREATE TABLE post (
-    id bigint DEFAULT nextval('post_seq'::regclass) NOT NULL,
-    name text,
-    description text,
-    type character varying(255),
-    created_at timestamp without time zone,
-    user_id bigint,
-    num_votes integer,
-    num_comments integer,
-    active boolean,
-    deactivated_by_id bigint,
-    deactivated_on timestamp without time zone,
-    deactivated_reason character varying(255),
-    fulfilled_at timestamp without time zone,
-    updated_at timestamp without time zone,
-    visibility integer DEFAULT 0,
-    start_time timestamp with time zone,
-    end_time timestamp with time zone,
-    location character varying(255),
-    created_from character varying(255),
-    parent_post_id bigint
-);
-
-
---
--- Name: post_community; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-CREATE TABLE post_community (
-    post_id bigint NOT NULL,
-    community_id bigint NOT NULL,
-    id integer NOT NULL,
-    pinned boolean DEFAULT false
-);
-
-
---
--- Name: post_community_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE post_community_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: post_community_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE post_community_id_seq OWNED BY post_community.id;
-
-
---
--- Name: post_view_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE post_view_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: posts_about_users; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-CREATE TABLE posts_about_users (
-    post_id bigint,
-    user_id bigint
-);
-
-
---
--- Name: posts_tags; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-CREATE TABLE posts_tags (
-    id integer NOT NULL,
-    post_id bigint,
-    tag_id bigint,
-    created_at timestamp with time zone,
-    updated_at timestamp with time zone,
-    selected boolean
-);
-
-
---
--- Name: posts_tags_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE posts_tags_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: posts_tags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE posts_tags_id_seq OWNED BY posts_tags.id;
-
-
---
--- Name: push_notifications; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-CREATE TABLE push_notifications (
-    id integer NOT NULL,
-    device_token character varying(255),
-    time_queued timestamp with time zone,
-    time_sent timestamp with time zone,
-    alert character varying(255) DEFAULT ''::character varying,
-    badge_no integer DEFAULT 0,
-    platform character varying(255),
-    path character varying(255)
-);
-
-
---
--- Name: queued_pushes_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE queued_pushes_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: queued_pushes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE queued_pushes_id_seq OWNED BY push_notifications.id;
-
-
---
--- Name: security_role_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE security_role_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: skill_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE skill_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: tags; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-CREATE TABLE tags (
-    id integer NOT NULL,
-    name character varying(255) NOT NULL,
-    created_at timestamp with time zone,
-    updated_at timestamp with time zone
-);
-
-
---
--- Name: tags_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE tags_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: tags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE tags_id_seq OWNED BY tags.id;
-
-
---
--- Name: tags_users; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-CREATE TABLE tags_users (
-    id integer NOT NULL,
-    tag_id bigint,
-    user_id bigint,
-    created_at timestamp with time zone,
-    updated_at timestamp with time zone
-);
-
-
---
--- Name: tags_users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE tags_users_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: tags_users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE tags_users_id_seq OWNED BY tags_users.id;
-
-
---
--- Name: thank_you_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE thank_you_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: thank_you; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-CREATE TABLE thank_you (
-    id bigint DEFAULT nextval('thank_you_seq'::regclass) NOT NULL,
-    comment_id bigint NOT NULL,
-    date_thanked timestamp without time zone NOT NULL,
-    user_id bigint NOT NULL,
-    thanked_by_id bigint NOT NULL
-);
-
-
---
--- Name: token_action_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE token_action_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: user_external_data; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-CREATE TABLE user_external_data (
-    id bigint NOT NULL,
-    user_id bigint,
-    type character varying(255),
-    data jsonb,
-    created_at timestamp with time zone,
-    updated_at timestamp with time zone
-);
-
-
---
--- Name: user_external_data_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE user_external_data_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: user_external_data_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE user_external_data_id_seq OWNED BY user_external_data.id;
-
-
---
--- Name: user_permission_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE user_permission_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: user_post_relevance_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE user_post_relevance_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: user_post_relevance; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-CREATE TABLE user_post_relevance (
-    id bigint DEFAULT nextval('user_post_relevance_seq'::regclass) NOT NULL,
-    user_id bigint,
-    post_id bigint,
-    similarity real,
-    created_at timestamp with time zone,
-    updated_at timestamp with time zone
-);
-
-
---
 -- Name: users_community_id_seq; Type: SEQUENCE; Schema: public; Owner: -
 --
 

    name character varying(255),
    width integer,
    height integer
);



    post_id bigint,
    date_voted timestamp without time zone
);


--
