--
--


--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: 
--

CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;


--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: 
--

COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';





--
-- Name: cache_invalidation; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE cache_invalidation (
    cache_id integer NOT NULL,
    cache_key character varying(255),
    cache_args character varying(255),
    cache_active boolean
);


ALTER TABLE public.cache_invalidation OWNER TO postgres;

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

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


ALTER TABLE public.cache_invalidation_cache_id_seq OWNER TO postgres;

--
-- Name: cache_invalidation_cache_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE cache_invalidation_cache_id_seq OWNED BY cache_invalidation.cache_id;


--
-- Name: changeset_comments; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE changeset_comments (
    comment_id integer NOT NULL,
    repo_id integer NOT NULL,
    revision character varying(40),
    pull_request_id integer,
    line_no character varying(10),
    hl_lines character varying(512),
    f_path character varying(1000),
    user_id integer NOT NULL,
    text text NOT NULL,
    created_on timestamp without time zone NOT NULL,
    modified_at timestamp without time zone NOT NULL
);


ALTER TABLE public.changeset_comments OWNER TO postgres;

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

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


ALTER TABLE public.changeset_comments_comment_id_seq OWNER TO postgres;

--
-- Name: changeset_comments_comment_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE changeset_comments_comment_id_seq OWNED BY changeset_comments.comment_id;


--
-- Name: changeset_statuses; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE changeset_statuses (
    changeset_status_id integer NOT NULL,
    repo_id integer NOT NULL,
    user_id integer NOT NULL,
    revision character varying(40) NOT NULL,
    status character varying(128) NOT NULL,
    changeset_comment_id integer,
    modified_at timestamp without time zone NOT NULL,
    version integer NOT NULL,
    pull_request_id integer
);


ALTER TABLE public.changeset_statuses OWNER TO postgres;

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

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


ALTER TABLE public.changeset_statuses_changeset_status_id_seq OWNER TO postgres;

--
-- Name: changeset_statuses_changeset_status_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE changeset_statuses_changeset_status_id_seq OWNED BY changeset_statuses.changeset_status_id;


--
-- Name: db_migrate_version; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE db_migrate_version (
    repository_id character varying(250) NOT NULL,
    repository_path text,
    version integer
);


ALTER TABLE public.db_migrate_version OWNER TO postgres;

--
-- Name: groups; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE groups (
    group_id integer NOT NULL,
    group_name character varying(255) NOT NULL,
    group_parent_id integer,
    group_description character varying(10000),
    enable_locking boolean NOT NULL,
    CONSTRAINT groups_check CHECK ((group_id <> group_parent_id))
);


ALTER TABLE public.groups OWNER TO postgres;

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

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


ALTER TABLE public.groups_group_id_seq OWNER TO postgres;

--
-- Name: groups_group_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE groups_group_id_seq OWNED BY groups.group_id;


--
-- Name: notifications; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE notifications (
    notification_id integer NOT NULL,
    subject character varying(512),
    body text,
    created_by integer,
    created_on timestamp without time zone NOT NULL,
    type character varying(256)
);


ALTER TABLE public.notifications OWNER TO postgres;

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

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


ALTER TABLE public.notifications_notification_id_seq OWNER TO postgres;

--
-- Name: notifications_notification_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE notifications_notification_id_seq OWNED BY notifications.notification_id;


--
-- Name: permissions; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE permissions (
    permission_id integer NOT NULL,
    permission_name character varying(255),
    permission_longname character varying(255)
);


ALTER TABLE public.permissions OWNER TO postgres;

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

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


ALTER TABLE public.permissions_permission_id_seq OWNER TO postgres;

--
-- Name: permissions_permission_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE permissions_permission_id_seq OWNED BY permissions.permission_id;


--
-- Name: pull_request_reviewers; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE pull_request_reviewers (
    pull_requests_reviewers_id integer NOT NULL,
    pull_request_id integer NOT NULL,
    user_id integer
);


ALTER TABLE public.pull_request_reviewers OWNER TO postgres;

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

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


ALTER TABLE public.pull_request_reviewers_pull_requests_reviewers_id_seq OWNER TO postgres;

--
-- Name: pull_request_reviewers_pull_requests_reviewers_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE pull_request_reviewers_pull_requests_reviewers_id_seq OWNED BY pull_request_reviewers.pull_requests_reviewers_id;


--
-- Name: pull_requests; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE pull_requests (
    pull_request_id integer NOT NULL,
    title character varying(256),
    description text,
    status character varying(256) NOT NULL,
    created_on timestamp without time zone NOT NULL,
    updated_on timestamp without time zone NOT NULL,
    user_id integer NOT NULL,
    revisions text,
    org_repo_id integer NOT NULL,
    org_ref character varying(256) NOT NULL,
    other_repo_id integer NOT NULL,
    other_ref character varying(256) NOT NULL
);


ALTER TABLE public.pull_requests OWNER TO postgres;

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

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


ALTER TABLE public.pull_requests_pull_request_id_seq OWNER TO postgres;

--
-- Name: pull_requests_pull_request_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE pull_requests_pull_request_id_seq OWNED BY pull_requests.pull_request_id;


--
-- Name: repo_to_perm; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE repo_to_perm (
    repo_to_perm_id integer NOT NULL,
    user_id integer NOT NULL,
    permission_id integer NOT NULL,
    repository_id integer NOT NULL
);


ALTER TABLE public.repo_to_perm OWNER TO postgres;

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

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


ALTER TABLE public.repo_to_perm_repo_to_perm_id_seq OWNER TO postgres;

--
-- Name: repo_to_perm_repo_to_perm_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE repo_to_perm_repo_to_perm_id_seq OWNED BY repo_to_perm.repo_to_perm_id;


--
-- Name: repositories; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE repositories (
    repo_id integer NOT NULL,
    repo_name character varying(255) NOT NULL,
    clone_uri character varying(255),
    repo_type character varying(255) NOT NULL,
    user_id integer NOT NULL,
    private boolean,
    statistics boolean,
    downloads boolean,
    description character varying(10000),
    created_on timestamp without time zone,
    updated_on timestamp without time zone,
    landing_revision character varying(255) NOT NULL,
    enable_locking boolean NOT NULL,
    locked character varying(255),
    changeset_cache bytea,
    fork_id integer,
    group_id integer
);


ALTER TABLE public.repositories OWNER TO postgres;

--
-- Name: repositories_fields; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE repositories_fields (
    repo_field_id integer NOT NULL,
    repository_id integer NOT NULL,
    field_key character varying(250),
    field_label character varying(1024) NOT NULL,
    field_value character varying(10000) NOT NULL,
    field_desc character varying(1024) NOT NULL,
    field_type character varying(256) NOT NULL,
    created_on timestamp without time zone NOT NULL
);


ALTER TABLE public.repositories_fields OWNER TO postgres;

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

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


ALTER TABLE public.repositories_fields_repo_field_id_seq OWNER TO postgres;

--
-- Name: repositories_fields_repo_field_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE repositories_fields_repo_field_id_seq OWNED BY repositories_fields.repo_field_id;


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

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


ALTER TABLE public.repositories_repo_id_seq OWNER TO postgres;

--
-- Name: repositories_repo_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE repositories_repo_id_seq OWNED BY repositories.repo_id;


--
-- Name: rhodecode_settings; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE rhodecode_settings (
    app_settings_id integer NOT NULL,
    app_settings_name character varying(255),
    app_settings_value character varying(255)
);


ALTER TABLE public.rhodecode_settings OWNER TO postgres;

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

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


ALTER TABLE public.rhodecode_settings_app_settings_id_seq OWNER TO postgres;

--
-- Name: rhodecode_settings_app_settings_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE rhodecode_settings_app_settings_id_seq OWNED BY rhodecode_settings.app_settings_id;


--
-- Name: rhodecode_ui; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE rhodecode_ui (
    ui_id integer NOT NULL,
    ui_section character varying(255),
    ui_key character varying(255),
    ui_value character varying(255),
    ui_active boolean
);


ALTER TABLE public.rhodecode_ui OWNER TO postgres;

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

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


ALTER TABLE public.rhodecode_ui_ui_id_seq OWNER TO postgres;

--
-- Name: rhodecode_ui_ui_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE rhodecode_ui_ui_id_seq OWNED BY rhodecode_ui.ui_id;


--
-- Name: statistics; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE statistics (
    stat_id integer NOT NULL,
    repository_id integer NOT NULL,
    stat_on_revision integer NOT NULL,
    commit_activity bytea NOT NULL,
    commit_activity_combined bytea NOT NULL,
    languages bytea NOT NULL
);


ALTER TABLE public.statistics OWNER TO postgres;

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

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


ALTER TABLE public.statistics_stat_id_seq OWNER TO postgres;

--
-- Name: statistics_stat_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE statistics_stat_id_seq OWNED BY statistics.stat_id;


--
-- Name: user_email_map; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE user_email_map (
    email_id integer NOT NULL,
    user_id integer,
    email character varying(255)
);


ALTER TABLE public.user_email_map OWNER TO postgres;

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

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


ALTER TABLE public.user_email_map_email_id_seq OWNER TO postgres;

--
-- Name: user_email_map_email_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE user_email_map_email_id_seq OWNED BY user_email_map.email_id;


--
-- Name: user_followings; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE user_followings (
    user_following_id integer NOT NULL,
    user_id integer NOT NULL,
    follows_repository_id integer,
    follows_user_id integer,
    follows_from timestamp without time zone
);


ALTER TABLE public.user_followings OWNER TO postgres;

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

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


ALTER TABLE public.user_followings_user_following_id_seq OWNER TO postgres;

--
-- Name: user_followings_user_following_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE user_followings_user_following_id_seq OWNED BY user_followings.user_following_id;


--
-- Name: user_ip_map; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE user_ip_map (
    ip_id integer NOT NULL,
    user_id integer,
    ip_addr character varying(255),
    active boolean
);


ALTER TABLE public.user_ip_map OWNER TO postgres;

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

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


ALTER TABLE public.user_ip_map_ip_id_seq OWNER TO postgres;

--
-- Name: user_ip_map_ip_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE user_ip_map_ip_id_seq OWNED BY user_ip_map.ip_id;


--
-- Name: user_logs; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE user_logs (
    user_log_id integer NOT NULL,
    user_id integer,
    username character varying(255),
    repository_id integer,
    repository_name character varying(255),
    user_ip character varying(255),
    action text,
    action_date timestamp without time zone
);


ALTER TABLE public.user_logs OWNER TO postgres;

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

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


ALTER TABLE public.user_logs_user_log_id_seq OWNER TO postgres;

--
-- Name: user_logs_user_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE user_logs_user_log_id_seq OWNED BY user_logs.user_log_id;


--
-- Name: user_repo_group_to_perm; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE user_repo_group_to_perm (
    group_to_perm_id integer NOT NULL,
    user_id integer NOT NULL,
    group_id integer NOT NULL,
    permission_id integer NOT NULL
);


ALTER TABLE public.user_repo_group_to_perm OWNER TO postgres;

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

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


ALTER TABLE public.user_repo_group_to_perm_group_to_perm_id_seq OWNER TO postgres;

--
-- Name: user_repo_group_to_perm_group_to_perm_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE user_repo_group_to_perm_group_to_perm_id_seq OWNED BY user_repo_group_to_perm.group_to_perm_id;


--
-- Name: user_to_notification; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE user_to_notification (
    user_id integer NOT NULL,
    notification_id integer NOT NULL,
    read boolean,
    sent_on timestamp without time zone
);


ALTER TABLE public.user_to_notification OWNER TO postgres;

--
-- Name: user_to_perm; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE user_to_perm (
    user_to_perm_id integer NOT NULL,
    user_id integer NOT NULL,
    permission_id integer NOT NULL
);


ALTER TABLE public.user_to_perm OWNER TO postgres;

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

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


ALTER TABLE public.user_to_perm_user_to_perm_id_seq OWNER TO postgres;

--
-- Name: user_to_perm_user_to_perm_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE user_to_perm_user_to_perm_id_seq OWNED BY user_to_perm.user_to_perm_id;

--
-- Name: users_group_repo_group_to_perm; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE users_group_repo_group_to_perm (
    users_group_repo_group_to_perm_id integer NOT NULL,
    users_group_id integer NOT NULL,
    group_id integer NOT NULL,
    permission_id integer NOT NULL
);


ALTER TABLE public.users_group_repo_group_to_perm OWNER TO postgres;

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

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


ALTER TABLE public.users_group_repo_group_to_per_users_group_repo_group_to_per_seq OWNER TO postgres;

--
-- Name: users_group_repo_group_to_per_users_group_repo_group_to_per_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE users_group_repo_group_to_per_users_group_repo_group_to_per_seq OWNED BY users_group_repo_group_to_perm.users_group_repo_group_to_perm_id;


--
-- Name: users_group_repo_to_perm; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE users_group_repo_to_perm (
    users_group_to_perm_id integer NOT NULL,
    users_group_id integer NOT NULL,
    permission_id integer NOT NULL,
    repository_id integer NOT NULL
);


ALTER TABLE public.users_group_repo_to_perm OWNER TO postgres;

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

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


ALTER TABLE public.users_group_repo_to_perm_users_group_to_perm_id_seq OWNER TO postgres;

--
-- Name: users_group_repo_to_perm_users_group_to_perm_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE users_group_repo_to_perm_users_group_to_perm_id_seq OWNED BY users_group_repo_to_perm.users_group_to_perm_id;


--
-- Name: users_group_to_perm; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE users_group_to_perm (
    users_group_to_perm_id integer NOT NULL,
    users_group_id integer NOT NULL,
    permission_id integer NOT NULL
);


ALTER TABLE public.users_group_to_perm OWNER TO postgres;

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

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


ALTER TABLE public.users_group_to_perm_users_group_to_perm_id_seq OWNER TO postgres;

--
-- Name: users_group_to_perm_users_group_to_perm_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE users_group_to_perm_users_group_to_perm_id_seq OWNED BY users_group_to_perm.users_group_to_perm_id;


--
-- Name: users_groups; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE users_groups (
    users_group_id integer NOT NULL,
    users_group_name character varying(255) NOT NULL,
    users_group_active boolean,
    users_group_inherit_default_permissions boolean NOT NULL
);


ALTER TABLE public.users_groups OWNER TO postgres;

--
-- Name: users_groups_members; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE users_groups_members (
    users_group_member_id integer NOT NULL,
    users_group_id integer NOT NULL,
    user_id integer NOT NULL
);


ALTER TABLE public.users_groups_members OWNER TO postgres;

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

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


ALTER TABLE public.users_groups_members_users_group_member_id_seq OWNER TO postgres;

--
-- Name: users_groups_members_users_group_member_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE users_groups_members_users_group_member_id_seq OWNED BY users_groups_members.users_group_member_id;


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

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


ALTER TABLE public.users_groups_users_group_id_seq OWNER TO postgres;

--
-- Name: users_groups_users_group_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE users_groups_users_group_id_seq OWNED BY users_groups.users_group_id;


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

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


ALTER TABLE public.users_user_id_seq OWNER TO postgres;

--
-- Name: users_user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE users_user_id_seq OWNED BY users.user_id;


--
-- Name: cache_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY cache_invalidation ALTER COLUMN cache_id SET DEFAULT nextval('cache_invalidation_cache_id_seq'::regclass);


--
-- Name: comment_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY changeset_comments ALTER COLUMN comment_id SET DEFAULT nextval('changeset_comments_comment_id_seq'::regclass);


--
-- Name: changeset_status_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY changeset_statuses ALTER COLUMN changeset_status_id SET DEFAULT nextval('changeset_statuses_changeset_status_id_seq'::regclass);


--
-- Name: group_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY groups ALTER COLUMN group_id SET DEFAULT nextval('groups_group_id_seq'::regclass);


--
-- Name: notification_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY notifications ALTER COLUMN notification_id SET DEFAULT nextval('notifications_notification_id_seq'::regclass);


--
-- Name: permission_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY permissions ALTER COLUMN permission_id SET DEFAULT nextval('permissions_permission_id_seq'::regclass);


--
-- Name: pull_requests_reviewers_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY pull_request_reviewers ALTER COLUMN pull_requests_reviewers_id SET DEFAULT nextval('pull_request_reviewers_pull_requests_reviewers_id_seq'::regclass);


--
-- Name: pull_request_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY pull_requests ALTER COLUMN pull_request_id SET DEFAULT nextval('pull_requests_pull_request_id_seq'::regclass);


--
-- Name: repo_to_perm_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY repo_to_perm ALTER COLUMN repo_to_perm_id SET DEFAULT nextval('repo_to_perm_repo_to_perm_id_seq'::regclass);


--
-- Name: repo_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY repositories ALTER COLUMN repo_id SET DEFAULT nextval('repositories_repo_id_seq'::regclass);


--
-- Name: repo_field_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY repositories_fields ALTER COLUMN repo_field_id SET DEFAULT nextval('repositories_fields_repo_field_id_seq'::regclass);


--
-- Name: app_settings_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY rhodecode_settings ALTER COLUMN app_settings_id SET DEFAULT nextval('rhodecode_settings_app_settings_id_seq'::regclass);


--
-- Name: ui_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY rhodecode_ui ALTER COLUMN ui_id SET DEFAULT nextval('rhodecode_ui_ui_id_seq'::regclass);


--
-- Name: stat_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY statistics ALTER COLUMN stat_id SET DEFAULT nextval('statistics_stat_id_seq'::regclass);


--
-- Name: email_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY user_email_map ALTER COLUMN email_id SET DEFAULT nextval('user_email_map_email_id_seq'::regclass);


--
-- Name: user_following_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY user_followings ALTER COLUMN user_following_id SET DEFAULT nextval('user_followings_user_following_id_seq'::regclass);


--
-- Name: ip_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY user_ip_map ALTER COLUMN ip_id SET DEFAULT nextval('user_ip_map_ip_id_seq'::regclass);


--
-- Name: user_log_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY user_logs ALTER COLUMN user_log_id SET DEFAULT nextval('user_logs_user_log_id_seq'::regclass);


--
-- Name: group_to_perm_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY user_repo_group_to_perm ALTER COLUMN group_to_perm_id SET DEFAULT nextval('user_repo_group_to_perm_group_to_perm_id_seq'::regclass);


--
-- Name: user_to_perm_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY user_to_perm ALTER COLUMN user_to_perm_id SET DEFAULT nextval('user_to_perm_user_to_perm_id_seq'::regclass);


--
-- Name: users_group_repo_group_to_perm_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY users_group_repo_group_to_perm ALTER COLUMN users_group_repo_group_to_perm_id SET DEFAULT nextval('users_group_repo_group_to_per_users_group_repo_group_to_per_seq'::regclass);


--
-- Name: users_group_to_perm_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY users_group_repo_to_perm ALTER COLUMN users_group_to_perm_id SET DEFAULT nextval('users_group_repo_to_perm_users_group_to_perm_id_seq'::regclass);


--
-- Name: users_group_to_perm_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY users_group_to_perm ALTER COLUMN users_group_to_perm_id SET DEFAULT nextval('users_group_to_perm_users_group_to_perm_id_seq'::regclass);


--
-- Name: users_group_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY users_groups ALTER COLUMN users_group_id SET DEFAULT nextval('users_groups_users_group_id_seq'::regclass);


--
-- Name: users_group_member_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY users_groups_members ALTER COLUMN users_group_member_id SET DEFAULT nextval('users_groups_members_users_group_member_id_seq'::regclass);


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

COPY cache_invalidation (cache_id, cache_key, cache_args, cache_active) FROM stdin;
1	1RC/mygr/lol	RC/mygr/lol	f
2	1RC/fakeclone	RC/fakeclone	t
3	1RC/muay	RC/muay	f
4	1BIG/git	BIG/git	t
5	1RC/origin-fork	RC/origin-fork	f
6	1one	one	f
7	1rhodecode.bak.1	rhodecode.bak.1	f
8	1csa-collins	csa-collins	t
9	1csa-harmony	csa-harmony	t
10	1RC/ąqweqwe	RC/ąqweqwe	f
11	1rhodecode	rhodecode	f
12	1csa-unity	csa-unity	t
13	1RC/łęcina	RC/łęcina	f
14	1waitress	waitress	t
15	1RC/rc2/test2	RC/rc2/test2	t
16	1RC/origin-fork-fork	RC/origin-fork-fork	f
17	1RC/rc2/test4	RC/rc2/test4	t
18	1RC/vcs-git	RC/vcs-git	t
19	1rhodecode-extensions	rhodecode-extensions	f
20	1rhodecode-cli-gist	rhodecode-cli-gist	f
21	1test.onaut.com	test.onaut.com	t
22	1RC/new	RC/new	f
23	1csa-aldrin	csa-aldrin	t
24	1vcs	vcs	f
25	1csa-prometheus	csa-prometheus	t
26	1RC/INRC/trololo	RC/INRC/trololo	f
27	1RC/empty-git	RC/empty-git	t
28	1csa-salt-states	csa-salt-states	t
29	1rhodecode-premium	rhodecode-premium	f
30	1RC/qweqwe-fork	RC/qweqwe-fork	f
31	1testrepo-quick	testrepo-quick	t
32	1RC/test	RC/test	f
33	1remote-salt	remote-salt	t
34	1BIG/android	BIG/android	t
35	1DOCS	DOCS	t
36	1rhodecode-git	rhodecode-git	t
37	1RC/bin-ops	RC/bin-ops	f
38	1RC/INRC/L2_NEW/lalalal	RC/INRC/L2_NEW/lalalal	f
39	1RC/fork-remote	RC/fork-remote	f
40	1RC/INRC/L2_NEW/L3/repo_test_move	RC/INRC/L2_NEW/L3/repo_test_move	f
41	1RC/gogo-fork	RC/gogo-fork	f
42	1quest	quest	f
43	1RC/foobar	RC/foobar	f
44	1csa-hyperion	csa-hyperion	t
45	1RC/git-pull-test	RC/git-pull-test	t
46	1RC/qweqwe-fork2	RC/qweqwe-fork2	f
47	1RC/jap	RC/jap	t
48	1RC/hg-repo	RC/hg-repo	f
49	1RC/origin	RC/origin	f
50	1rhodecode-cli-api	rhodecode-cli-api	f
51	1RC/rc2/test3	RC/rc2/test3	t
52	1csa-armstrong	csa-armstrong	t
53	1RC/trololo	RC/trololo	f
54	1testrepo-wp	testrepo-wp	t
55	1pyramidpypi	pyramidpypi	t
56	1salt	salt	t
57	1RC/lol/haha	RC/lol/haha	f
58	1csa-io	csa-io	t
59	1enc-envelope	enc-envelope	f
60	1RC/gogo2	RC/gogo2	f
61	1csa-libcloud	csa-libcloud	t
62	1RC/git-test	RC/git-test	t
63	1RC/rc2/test	RC/rc2/test	f
64	1rhodecode.bak	rhodecode.bak	f
65	1RC/kiall-nova	RC/kiall-nova	t
\.



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

COPY changeset_comments (comment_id, repo_id, revision, pull_request_id, line_no, hl_lines, f_path, user_id, text, created_on, modified_at) FROM stdin;
\.



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

COPY changeset_statuses (changeset_status_id, repo_id, user_id, revision, status, changeset_comment_id, modified_at, version, pull_request_id) FROM stdin;
\.



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

COPY db_migrate_version (repository_id, repository_path, version) FROM stdin;
rhodecode_db_migrations	versions	11
\.


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

COPY groups (group_id, group_name, group_parent_id, group_description, enable_locking) FROM stdin;
1	RC	\N	RC group	f
2	RC/mygr	1	RC/mygr group	f
3	BIG	\N	BIG group	f
4	RC/rc2	1	RC/rc2 group	f
5	RC/INRC	1	RC/INRC group	f
6	RC/INRC/L2_NEW	5	RC/INRC/L2_NEW group	f
7	RC/INRC/L2_NEW/L3	6	RC/INRC/L2_NEW/L3 group	f
8	RC/lol	1	RC/lol group	f
\.



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

COPY notifications (notification_id, subject, body, created_by, created_on, type) FROM stdin;
\.



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

COPY permissions (permission_id, permission_name, permission_longname) FROM stdin;
1	repository.none	repository.none
2	repository.read	repository.read
3	repository.write	repository.write
4	repository.admin	repository.admin
5	group.none	group.none
6	group.read	group.read
7	group.write	group.write
8	group.admin	group.admin
9	hg.admin	hg.admin
10	hg.create.none	hg.create.none
11	hg.create.repository	hg.create.repository
12	hg.fork.none	hg.fork.none
13	hg.fork.repository	hg.fork.repository
14	hg.register.none	hg.register.none
15	hg.register.manual_activate	hg.register.manual_activate
16	hg.register.auto_activate	hg.register.auto_activate
\.



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

COPY pull_request_reviewers (pull_requests_reviewers_id, pull_request_id, user_id) FROM stdin;
\.



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

COPY pull_requests (pull_request_id, title, description, status, created_on, updated_on, user_id, revisions, org_repo_id, org_ref, other_repo_id, other_ref) FROM stdin;
\.



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

COPY repo_to_perm (repo_to_perm_id, user_id, permission_id, repository_id) FROM stdin;
1	1	2	1
2	1	2	2
3	1	2	3
4	1	2	4
5	1	2	5
6	1	2	6
7	1	2	7
8	1	2	8
9	1	2	9
10	1	2	10
11	1	2	11
12	1	2	12
13	1	2	13
14	1	2	14
15	1	2	15
16	1	2	16
17	1	2	17
18	1	2	18
19	1	2	19
20	1	2	20
21	1	2	21
22	1	2	22
23	1	2	23
24	1	2	24
25	1	2	25
26	1	2	26
27	1	2	27
28	1	2	28
29	1	2	29
30	1	2	30
31	1	2	31
32	1	2	32
33	1	2	33
34	1	2	34
35	1	2	35
36	1	2	36
37	1	2	37
38	1	2	38
39	1	2	39
40	1	2	40
41	1	2	41
42	1	2	42
43	1	2	43
44	1	2	44
45	1	2	45
46	1	2	46
47	1	2	47
48	1	2	48
49	1	2	49
50	1	2	50
51	1	2	51
52	1	2	52
53	1	2	53
54	1	2	54
55	1	2	55
56	1	2	56
57	1	2	57
58	1	2	58
59	1	2	59
60	1	2	60
61	1	2	61
62	1	2	62
63	1	2	63
64	1	2	64
65	1	2	65
\.



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

COPY repositories (repo_id, repo_name, clone_uri, repo_type, user_id, private, statistics, downloads, description, created_on, updated_on, landing_revision, enable_locking, locked, changeset_cache, fork_id, group_id) FROM stdin;
1	RC/mygr/lol	http://user@vm/RC/mygr/lol	hg	2	f	f	f	RC/mygr/lol repository	2013-05-28 20:26:59.886314	2013-05-28 20:26:59.886502	tip	f	\N	\N	\N	2
2	RC/fakeclone	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:26:59.94415	2013-05-09 01:48:00	tip	f	\N	\\x[BLOB]	\N	1
3	RC/muay	\N	hg	2	f	f	f	RC/muay repository	2013-05-28 20:27:00.114841	2013-05-28 20:27:00.114864	tip	f	\N	\N	\N	1
4	BIG/git	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:00.171891	2012-10-21 23:47:54	tip	f	\N	\\x[BLOB]	\N	3
5	RC/origin-fork	\N	hg	2	f	f	f	RC/origin-fork repository	2013-05-28 20:27:01.457264	2013-03-06 20:16:20	tip	f	\N	\\x[BLOB]	\N	1
6	one	\N	hg	2	f	f	f	one repository	2013-05-28 20:27:01.525404	2013-05-23 12:11:57	tip	f	\N	\\x[BLOB]	\N	\N
7	rhodecode.bak.1	\N	hg	2	f	f	f	rhodecode.bak.1 repository	2013-05-28 20:27:01.578685	2013-05-28 14:44:56	tip	f	\N	\\x[BLOB]	\N	\N
8	csa-collins	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:01.645073	2013-02-25 17:31:39	tip	f	\N	\\x[BLOB]	\N	\N
9	csa-harmony	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:01.870853	2013-05-22 14:49:45	tip	f	\N	\\x[BLOB]	\N	\N
10	RC/ąqweqwe	\N	hg	2	f	f	f	RC/ąqweqwe repository	2013-05-28 20:27:02.376512	2013-05-28 20:27:02.376535	tip	f	\N	\N	\N	1
11	rhodecode	\N	hg	2	f	f	f	rhodecode repository	2013-05-28 20:27:02.424079	2013-05-28 20:16:08	tip	f	\N	\\x[BLOB]	\N	\N
12	csa-unity	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:02.495342	2013-04-29 14:38:23	tip	f	\N	\\x[BLOB]	\N	\N
13	RC/łęcina	\N	hg	2	f	f	f	RC/łęcina repository	2013-05-28 20:27:02.664128	2013-03-06 16:17:49	tip	f	\N	\\x[BLOB]	\N	1
14	waitress	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:02.721063	2013-05-28 13:21:35	tip	f	\N	\\x[BLOB]	\N	\N
15	RC/rc2/test2	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:02.896717	2013-03-03 00:29:35	tip	f	\N	\\x[BLOB]	\N	4
16	RC/origin-fork-fork	\N	hg	2	f	f	f	RC/origin-fork-fork repository	2013-05-28 20:27:03.013741	2013-05-06 23:44:50	tip	f	\N	\\x[BLOB]	\N	1
17	RC/rc2/test4	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:03.077195	2013-03-21 22:55:29	tip	f	\N	\\x[BLOB]	\N	4
18	RC/vcs-git	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:03.207037	2013-04-26 23:34:15	tip	f	\N	\\x[BLOB]	\N	1
19	rhodecode-extensions	\N	hg	2	f	f	f	rhodecode-extensions repository	2013-05-28 20:27:03.363473	2013-02-13 16:50:33	tip	f	\N	\\x[BLOB]	\N	\N
20	rhodecode-cli-gist	\N	hg	2	f	f	f	rhodecode-cli-gist repository	2013-05-28 20:27:03.415835	2013-05-28 20:27:03.415858	tip	f	\N	\N	\N	\N
21	test.onaut.com	\N	git	2	f	f	f	Unnamed repository	2013-05-28 20:27:03.46164	2013-04-29 11:08:31	tip	f	\N	\\x[BLOB]	\N	\N
22	RC/new	\N	hg	2	f	f	f	RC/new repository	2013-05-28 20:27:03.580255	2013-04-17 13:02:59	tip	f	\N	\\x[BLOB]	\N	1
46	RC/qweqwe-fork2	\N	hg	2	f	f	f	RC/qweqwe-fork2 repository	2013-05-28 20:27:17.359662	2013-05-28 20:27:17.359684	tip	f	\N	\N	\N	1
23	csa-aldrin	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:03.639793	2013-05-02 23:47:52	tip	f	\N	\\x[BLOB]	\N	\N
24	vcs	\N	hg	2	f	f	f	vcs repository	2013-05-28 20:27:03.856575	2013-05-09 00:28:54	tip	f	\N	\\x[BLOB]	\N	\N
25	csa-prometheus	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:03.916977	2013-04-29 14:37:43	tip	f	\N	\\x[BLOB]	\N	\N
26	RC/INRC/trololo	\N	hg	2	f	f	f	RC/INRC/trololo repository	2013-05-28 20:27:04.096413	2013-05-28 20:27:04.096437	tip	f	\N	\N	\N	5
27	RC/empty-git	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:04.148472	2013-05-28 20:27:04.148509	tip	f	\N	\N	\N	1
28	csa-salt-states	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:04.212846	2013-05-06 14:48:48	tip	f	\N	\\x[BLOB]	\N	\N
29	rhodecode-premium	\N	hg	2	f	f	f	rhodecode-premium repository	2013-05-28 20:27:04.419538	2013-03-21 22:58:11	tip	f	\N	\\x[BLOB]	\N	\N
30	RC/qweqwe-fork	\N	hg	2	f	f	f	RC/qweqwe-fork repository	2013-05-28 20:27:04.494164	2013-05-28 20:27:04.494188	tip	f	\N	\N	\N	1
31	testrepo-quick	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:04.547757	2012-08-31 11:34:33	tip	f	\N	\\x[BLOB]	\N	\N
32	RC/test	\N	hg	2	f	f	f	RC/test repository	2013-05-28 20:27:04.697514	2013-01-30 22:56:03	tip	f	\N	\\x[BLOB]	\N	1
33	remote-salt	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:04.750525	2012-10-14 22:04:05	tip	f	\N	\\x[BLOB]	\N	\N
34	BIG/android	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:04.869224	2012-06-17 00:44:46	tip	f	\N	\\x[BLOB]	\N	3
35	DOCS	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:16.065483	2013-04-25 16:45:59	tip	f	\N	\\x[BLOB]	\N	\N
36	rhodecode-git	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:16.225335	2013-01-04 00:24:22	tip	f	\N	\\x[BLOB]	\N	\N
37	RC/bin-ops	\N	hg	2	f	f	f	RC/bin-ops repository	2013-05-28 20:27:16.463774	2013-05-12 12:39:34	tip	f	\N	\\x[BLOB]	\N	1
38	RC/INRC/L2_NEW/lalalal	\N	hg	2	f	f	f	RC/INRC/L2_NEW/lalalal repository	2013-05-28 20:27:16.555625	2013-05-28 20:27:16.55565	tip	f	\N	\N	\N	6
39	RC/fork-remote	\N	hg	2	f	f	f	RC/fork-remote repository	2013-05-28 20:27:16.622524	2013-03-10 22:47:24	tip	f	\N	\\x[BLOB]	\N	1
40	RC/INRC/L2_NEW/L3/repo_test_move	\N	hg	2	f	f	f	RC/INRC/L2_NEW/L3/repo_test_move repository	2013-05-28 20:27:16.717095	2013-05-28 20:27:16.717133	tip	f	\N	\N	\N	7
41	RC/gogo-fork	\N	hg	2	f	f	f	RC/gogo-fork repository	2013-05-28 20:27:16.790103	2013-05-28 20:27:16.790129	tip	f	\N	\N	\N	1
42	quest	\N	hg	2	f	f	f	quest repository	2013-05-28 20:27:16.858741	2013-03-04 23:01:40	tip	f	\N	\\x[BLOB]	\N	\N
43	RC/foobar	\N	hg	2	f	f	f	RC/foobar repository	2013-05-28 20:27:16.930525	2013-04-15 21:34:57	tip	f	\N	\\x[BLOB]	\N	1
44	csa-hyperion	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:17.021283	2013-05-20 21:58:28	tip	f	\N	\\x[BLOB]	\N	\N
45	RC/git-pull-test	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:17.231975	2013-05-20 13:03:02	tip	f	\N	\\x[BLOB]	\N	1
47	RC/jap	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:17.427862	2013-04-24 11:15:30	tip	f	\N	\\x[BLOB]	\N	1
48	RC/hg-repo	\N	hg	2	f	f	f	RC/hg-repo repository	2013-05-28 20:27:17.558936	2013-05-08 22:54:45	tip	f	\N	\\x[BLOB]	\N	1
49	RC/origin	\N	hg	2	f	f	f	RC/origin repository	2013-05-28 20:27:17.634344	2013-04-05 13:05:02	tip	f	\N	\\x[BLOB]	\N	1
50	rhodecode-cli-api	\N	hg	2	f	f	f	rhodecode-cli-api repository	2013-05-28 20:27:17.708944	2013-05-28 20:27:17.708995	tip	f	\N	\N	\N	\N
51	RC/rc2/test3	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:17.781161	2013-03-03 00:29:35	tip	f	\N	\\x[BLOB]	\N	4
52	csa-armstrong	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:17.898234	2013-05-22 18:10:20	tip	f	\N	\\x[BLOB]	\N	\N
53	RC/trololo	\N	hg	2	f	f	f	RC/trololo repository	2013-05-28 20:27:18.620592	2013-03-28 02:35:50	tip	f	\N	\\x[BLOB]	\N	1
54	testrepo-wp	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:18.695645	2012-08-27 11:05:37	tip	f	\N	\\x[BLOB]	\N	\N
55	pyramidpypi	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:18.824235	2013-04-25 16:34:48	tip	f	\N	\\x[BLOB]	\N	\N
56	salt	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:19.036099	2012-10-15 05:20:58	tip	f	\N	\\x[BLOB]	\N	\N
57	RC/lol/haha	\N	hg	2	f	f	f	RC/lol/haha repository	2013-05-28 20:27:19.44935	2013-05-28 20:27:19.449372	tip	f	\N	\N	\N	8
58	csa-io	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:19.531664	2013-05-02 22:52:54	tip	f	\N	\\x[BLOB]	\N	\N
59	enc-envelope	\N	hg	2	f	f	f	enc-envelope repository	2013-05-28 20:27:19.74793	2013-03-07 15:37:40	tip	f	\N	\\x[BLOB]	\N	\N
60	RC/gogo2	\N	hg	2	f	f	f	RC/gogo2 repository	2013-05-28 20:27:19.827312	2013-05-28 20:27:19.827334	tip	f	\N	\N	\N	1
61	csa-libcloud	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:19.892075	2013-04-17 16:42:42	tip	f	\N	\\x[BLOB]	\N	\N
62	RC/git-test	\N	git	2	f	f	f	Unnamed repository	2013-05-28 20:27:20.231554	2013-03-25 22:50:04	tip	f	\N	\\x[BLOB]	\N	1
63	RC/rc2/test	\N	hg	2	f	f	f	RC/rc2/test repository	2013-05-28 20:27:20.356786	2013-05-28 20:27:20.35683	tip	f	\N	\N	\N	4
64	rhodecode.bak	\N	hg	2	f	f	f	rhodecode.bak repository	2013-05-28 20:27:20.423238	2013-05-28 02:41:49	tip	f	\N	\\x[BLOB]	\N	\N
65	RC/kiall-nova	\N	git	2	f	f	f	Unnamed repository; edit this file 'description' to name the repository.\n	2013-05-28 20:27:20.524084	2012-10-23 10:22:06	tip	f	\N	\\x[BLOB]	\N	1
\.


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

COPY repositories_fields (repo_field_id, repository_id, field_key, field_label, field_value, field_desc, field_type, created_on) FROM stdin;
\.



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

COPY rhodecode_settings (app_settings_id, app_settings_name, app_settings_value) FROM stdin;
1	realm	RhodeCode authentication
2	title	RhodeCode
3	ga_code	123456
4	show_public_icon	True
5	show_private_icon	True
6	stylify_metatags	False
7	ldap_active	false
8	ldap_host	
9	ldap_port	389
10	ldap_tls_kind	PLAIN
11	ldap_tls_reqcert	
12	ldap_dn_user	
13	ldap_dn_pass	
14	ldap_base_dn	
15	ldap_filter	
16	ldap_search_scope	
17	ldap_attr_login	
18	ldap_attr_firstname	
19	ldap_attr_lastname	
20	ldap_attr_email	
21	default_repo_enable_locking	False
22	default_repo_enable_downloads	False
23	default_repo_enable_statistics	False
24	default_repo_private	False
25	default_repo_type	hg
\.



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

COPY rhodecode_ui (ui_id, ui_section, ui_key, ui_value, ui_active) FROM stdin;
1	hooks	changegroup.update	hg update >&2	f
2	hooks	changegroup.repo_size	python:rhodecode.lib.hooks.repo_size	t
3	hooks	changegroup.push_logger	python:rhodecode.lib.hooks.log_push_action	t
4	hooks	prechangegroup.pre_push	python:rhodecode.lib.hooks.pre_push	t
5	hooks	outgoing.pull_logger	python:rhodecode.lib.hooks.log_pull_action	t
6	hooks	preoutgoing.pre_pull	python:rhodecode.lib.hooks.pre_pull	t
7	extensions	largefiles		t
8	extensions	hgsubversion		f
9	extensions	hggit		f
10	web	push_ssl	false	t
11	web	allow_archive	gz zip bz2	t
12	web	allow_push	*	t
13	web	baseurl	/	t
14	paths	/	/mnt/hgfs/workspace-python	t
\.



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

COPY statistics (stat_id, repository_id, stat_on_revision, commit_activity, commit_activity_combined, languages) FROM stdin;
\.



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

COPY user_email_map (email_id, user_id, email) FROM stdin;
\.



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

COPY user_followings (user_following_id, user_id, follows_repository_id, follows_user_id, follows_from) FROM stdin;
1	2	1	\N	2013-05-28 20:26:59.905946
2	2	2	\N	2013-05-28 20:26:59.958581
3	2	3	\N	2013-05-28 20:27:00.145566
4	2	4	\N	2013-05-28 20:27:00.184438
5	2	5	\N	2013-05-28 20:27:01.507836
6	2	6	\N	2013-05-28 20:27:01.562696
7	2	7	\N	2013-05-28 20:27:01.630538
8	2	8	\N	2013-05-28 20:27:01.658765
9	2	9	\N	2013-05-28 20:27:01.883077
10	2	10	\N	2013-05-28 20:27:02.410512
11	2	11	\N	2013-05-28 20:27:02.47039
12	2	12	\N	2013-05-28 20:27:02.512861
13	2	13	\N	2013-05-28 20:27:02.705559
14	2	14	\N	2013-05-28 20:27:02.736051
15	2	15	\N	2013-05-28 20:27:02.909458
16	2	16	\N	2013-05-28 20:27:03.058143
17	2	17	\N	2013-05-28 20:27:03.092663
18	2	18	\N	2013-05-28 20:27:03.220556
19	2	19	\N	2013-05-28 20:27:03.401209
20	2	20	\N	2013-05-28 20:27:03.446846
21	2	21	\N	2013-05-28 20:27:03.478718
22	2	22	\N	2013-05-28 20:27:03.625506
23	2	23	\N	2013-05-28 20:27:03.654446
24	2	24	\N	2013-05-28 20:27:03.90204
25	2	25	\N	2013-05-28 20:27:03.935584
26	2	26	\N	2013-05-28 20:27:04.133528
27	2	27	\N	2013-05-28 20:27:04.165426
28	2	28	\N	2013-05-28 20:27:04.227192
29	2	29	\N	2013-05-28 20:27:04.470074
30	2	30	\N	2013-05-28 20:27:04.535036
31	2	31	\N	2013-05-28 20:27:04.56081
32	2	32	\N	2013-05-28 20:27:04.73511
33	2	33	\N	2013-05-28 20:27:04.762367
34	2	34	\N	2013-05-28 20:27:04.882269
35	2	35	\N	2013-05-28 20:27:16.081624
36	2	36	\N	2013-05-28 20:27:16.238074
37	2	37	\N	2013-05-28 20:27:16.490921
38	2	38	\N	2013-05-28 20:27:16.606332
39	2	39	\N	2013-05-28 20:27:16.683877
40	2	40	\N	2013-05-28 20:27:16.772204
41	2	41	\N	2013-05-28 20:27:16.846091
42	2	42	\N	2013-05-28 20:27:16.915625
43	2	43	\N	2013-05-28 20:27:17.000652
44	2	44	\N	2013-05-28 20:27:17.035001
45	2	45	\N	2013-05-28 20:27:17.245544
46	2	46	\N	2013-05-28 20:27:17.412282
47	2	47	\N	2013-05-28 20:27:17.442703
48	2	48	\N	2013-05-28 20:27:17.616299
49	2	49	\N	2013-05-28 20:27:17.694907
50	2	50	\N	2013-05-28 20:27:17.76193
51	2	51	\N	2013-05-28 20:27:17.796316
52	2	52	\N	2013-05-28 20:27:17.911214
53	2	53	\N	2013-05-28 20:27:18.67818
54	2	54	\N	2013-05-28 20:27:18.712023
55	2	55	\N	2013-05-28 20:27:18.837132
56	2	56	\N	2013-05-28 20:27:19.053951
57	2	57	\N	2013-05-28 20:27:19.51609
58	2	58	\N	2013-05-28 20:27:19.543354
59	2	59	\N	2013-05-28 20:27:19.809302
60	2	60	\N	2013-05-28 20:27:19.877469
61	2	61	\N	2013-05-28 20:27:19.908981
62	2	62	\N	2013-05-28 20:27:20.247031
63	2	63	\N	2013-05-28 20:27:20.410876
64	2	64	\N	2013-05-28 20:27:20.506094
65	2	65	\N	2013-05-28 20:27:20.536866
\.



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

COPY user_ip_map (ip_id, user_id, ip_addr, active) FROM stdin;
\.



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

COPY user_logs (user_log_id, user_id, username, repository_id, repository_name, user_ip, action, action_date) FROM stdin;
1	2	marcink	1	RC/mygr/lol		started_following_repo	2013-05-28 20:26:59.900931
2	2	marcink	2	RC/fakeclone		started_following_repo	2013-05-28 20:26:59.955428
3	2	marcink	3	RC/muay		started_following_repo	2013-05-28 20:27:00.125953
4	2	marcink	4	BIG/git		started_following_repo	2013-05-28 20:27:00.181617
5	2	marcink	5	RC/origin-fork		started_following_repo	2013-05-28 20:27:01.466724
6	2	marcink	6	one		started_following_repo	2013-05-28 20:27:01.536732
7	2	marcink	7	rhodecode.bak.1		started_following_repo	2013-05-28 20:27:01.589472
8	2	marcink	8	csa-collins		started_following_repo	2013-05-28 20:27:01.655365
9	2	marcink	9	csa-harmony		started_following_repo	2013-05-28 20:27:01.88057
10	2	marcink	10	RC/ąqweqwe		started_following_repo	2013-05-28 20:27:02.387499
11	2	marcink	11	rhodecode		started_following_repo	2013-05-28 20:27:02.433418
12	2	marcink	12	csa-unity		started_following_repo	2013-05-28 20:27:02.508796
13	2	marcink	13	RC/łęcina		started_following_repo	2013-05-28 20:27:02.674658
14	2	marcink	14	waitress		started_following_repo	2013-05-28 20:27:02.73244
15	2	marcink	15	RC/rc2/test2		started_following_repo	2013-05-28 20:27:02.906659
16	2	marcink	16	RC/origin-fork-fork		started_following_repo	2013-05-28 20:27:03.02717
17	2	marcink	17	RC/rc2/test4		started_following_repo	2013-05-28 20:27:03.090085
18	2	marcink	18	RC/vcs-git		started_following_repo	2013-05-28 20:27:03.218033
19	2	marcink	19	rhodecode-extensions		started_following_repo	2013-05-28 20:27:03.374166
20	2	marcink	20	rhodecode-cli-gist		started_following_repo	2013-05-28 20:27:03.425087
21	2	marcink	21	test.onaut.com		started_following_repo	2013-05-28 20:27:03.473193
22	2	marcink	22	RC/new		started_following_repo	2013-05-28 20:27:03.593153
23	2	marcink	23	csa-aldrin		started_following_repo	2013-05-28 20:27:03.651182
24	2	marcink	24	vcs		started_following_repo	2013-05-28 20:27:03.866907
25	2	marcink	25	csa-prometheus		started_following_repo	2013-05-28 20:27:03.931789
26	2	marcink	26	RC/INRC/trololo		started_following_repo	2013-05-28 20:27:04.108947
27	2	marcink	27	RC/empty-git		started_following_repo	2013-05-28 20:27:04.162816
28	2	marcink	28	csa-salt-states		started_following_repo	2013-05-28 20:27:04.224517
29	2	marcink	29	rhodecode-premium		started_following_repo	2013-05-28 20:27:04.429318
30	2	marcink	30	RC/qweqwe-fork		started_following_repo	2013-05-28 20:27:04.508625
31	2	marcink	31	testrepo-quick		started_following_repo	2013-05-28 20:27:04.558071
32	2	marcink	32	RC/test		started_following_repo	2013-05-28 20:27:04.707963
33	2	marcink	33	remote-salt		started_following_repo	2013-05-28 20:27:04.759601
34	2	marcink	34	BIG/android		started_following_repo	2013-05-28 20:27:04.879601
35	2	marcink	35	DOCS		started_following_repo	2013-05-28 20:27:16.077043
36	2	marcink	36	rhodecode-git		started_following_repo	2013-05-28 20:27:16.235309
37	2	marcink	37	RC/bin-ops		started_following_repo	2013-05-28 20:27:16.474785
38	2	marcink	38	RC/INRC/L2_NEW/lalalal		started_following_repo	2013-05-28 20:27:16.566047
39	2	marcink	39	RC/fork-remote		started_following_repo	2013-05-28 20:27:16.636895
40	2	marcink	40	RC/INRC/L2_NEW/L3/repo_test_move		started_following_repo	2013-05-28 20:27:16.73064
41	2	marcink	41	RC/gogo-fork		started_following_repo	2013-05-28 20:27:16.801352
42	2	marcink	42	quest		started_following_repo	2013-05-28 20:27:16.870218
43	2	marcink	43	RC/foobar		started_following_repo	2013-05-28 20:27:16.94344
44	2	marcink	44	csa-hyperion		started_following_repo	2013-05-28 20:27:17.032368
45	2	marcink	45	RC/git-pull-test		started_following_repo	2013-05-28 20:27:17.242321
46	2	marcink	46	RC/qweqwe-fork2		started_following_repo	2013-05-28 20:27:17.369718
47	2	marcink	47	RC/jap		started_following_repo	2013-05-28 20:27:17.438737
48	2	marcink	48	RC/hg-repo		started_following_repo	2013-05-28 20:27:17.568968
49	2	marcink	49	RC/origin		started_following_repo	2013-05-28 20:27:17.647722
50	2	marcink	50	rhodecode-cli-api		started_following_repo	2013-05-28 20:27:17.720735
51	2	marcink	51	RC/rc2/test3		started_following_repo	2013-05-28 20:27:17.793213
52	2	marcink	52	csa-armstrong		started_following_repo	2013-05-28 20:27:17.908068
53	2	marcink	53	RC/trololo		started_following_repo	2013-05-28 20:27:18.630661
54	2	marcink	54	testrepo-wp		started_following_repo	2013-05-28 20:27:18.707708
55	2	marcink	55	pyramidpypi		started_following_repo	2013-05-28 20:27:18.834547
56	2	marcink	56	salt		started_following_repo	2013-05-28 20:27:19.050625
57	2	marcink	57	RC/lol/haha		started_following_repo	2013-05-28 20:27:19.462058
58	2	marcink	58	csa-io		started_following_repo	2013-05-28 20:27:19.540782
59	2	marcink	59	enc-envelope		started_following_repo	2013-05-28 20:27:19.758453
60	2	marcink	60	RC/gogo2		started_following_repo	2013-05-28 20:27:19.838573
61	2	marcink	61	csa-libcloud		started_following_repo	2013-05-28 20:27:19.904526
62	2	marcink	62	RC/git-test		started_following_repo	2013-05-28 20:27:20.243692
63	2	marcink	63	RC/rc2/test		started_following_repo	2013-05-28 20:27:20.36788
64	2	marcink	64	rhodecode.bak		started_following_repo	2013-05-28 20:27:20.435328
65	2	marcink	65	RC/kiall-nova		started_following_repo	2013-05-28 20:27:20.533474
\.



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

COPY user_repo_group_to_perm (group_to_perm_id, user_id, group_id, permission_id) FROM stdin;
1	1	1	6
2	1	2	6
3	1	3	6
4	1	4	6
5	1	5	6
6	1	6	6
7	1	7	6
8	1	8	6
\.



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

COPY user_to_notification (user_id, notification_id, read, sent_on) FROM stdin;
\.


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

COPY user_to_perm (user_to_perm_id, user_id, permission_id) FROM stdin;
1	1	15
2	1	11
3	1	13
4	1	2
5	1	6
\.



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

COPY users_group_repo_group_to_perm (users_group_repo_group_to_perm_id, users_group_id, group_id, permission_id) FROM stdin;
\.


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

COPY users_group_repo_to_perm (users_group_to_perm_id, users_group_id, permission_id, repository_id) FROM stdin;
\.



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

COPY users_group_to_perm (users_group_to_perm_id, users_group_id, permission_id) FROM stdin;
\.



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

COPY users_groups (users_group_id, users_group_name, users_group_active, users_group_inherit_default_permissions) FROM stdin;
\.


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

COPY users_groups_members (users_group_member_id, users_group_id, user_id) FROM stdin;
\.



--
-- Name: cache_invalidation_cache_key_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY cache_invalidation
    ADD CONSTRAINT cache_invalidation_cache_key_key UNIQUE (cache_key);


--
-- Name: cache_invalidation_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY cache_invalidation
    ADD CONSTRAINT cache_invalidation_pkey PRIMARY KEY (cache_id);


--
-- Name: changeset_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY changeset_comments
    ADD CONSTRAINT changeset_comments_pkey PRIMARY KEY (comment_id);


--
-- Name: changeset_statuses_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY changeset_statuses
    ADD CONSTRAINT changeset_statuses_pkey PRIMARY KEY (changeset_status_id);


--
-- Name: changeset_statuses_repo_id_revision_version_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY changeset_statuses
    ADD CONSTRAINT changeset_statuses_repo_id_revision_version_key UNIQUE (repo_id, revision, version);


--
-- Name: db_migrate_version_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY db_migrate_version
    ADD CONSTRAINT db_migrate_version_pkey PRIMARY KEY (repository_id);


--
-- Name: groups_group_name_group_parent_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY groups
    ADD CONSTRAINT groups_group_name_group_parent_id_key UNIQUE (group_name, group_parent_id);


--
-- Name: groups_group_name_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY groups
    ADD CONSTRAINT groups_group_name_key UNIQUE (group_name);


--
-- Name: groups_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY groups
    ADD CONSTRAINT groups_pkey PRIMARY KEY (group_id);


--
-- Name: notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY notifications
    ADD CONSTRAINT notifications_pkey PRIMARY KEY (notification_id);


--
-- Name: permissions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY permissions
    ADD CONSTRAINT permissions_pkey PRIMARY KEY (permission_id);


--
-- Name: pull_request_reviewers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY pull_request_reviewers
    ADD CONSTRAINT pull_request_reviewers_pkey PRIMARY KEY (pull_requests_reviewers_id);


--
-- Name: pull_requests_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY pull_requests
    ADD CONSTRAINT pull_requests_pkey PRIMARY KEY (pull_request_id);


--
-- Name: repo_to_perm_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY repo_to_perm
    ADD CONSTRAINT repo_to_perm_pkey PRIMARY KEY (repo_to_perm_id);


--
-- Name: repo_to_perm_user_id_repository_id_permission_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY repo_to_perm
    ADD CONSTRAINT repo_to_perm_user_id_repository_id_permission_id_key UNIQUE (user_id, repository_id, permission_id);


--
-- Name: repositories_fields_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY repositories_fields
    ADD CONSTRAINT repositories_fields_pkey PRIMARY KEY (repo_field_id);


--
-- Name: repositories_fields_repository_id_field_key_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY repositories_fields
    ADD CONSTRAINT repositories_fields_repository_id_field_key_key UNIQUE (repository_id, field_key);


--
-- Name: repositories_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY repositories
    ADD CONSTRAINT repositories_pkey PRIMARY KEY (repo_id);


--
-- Name: repositories_repo_name_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY repositories
    ADD CONSTRAINT repositories_repo_name_key UNIQUE (repo_name);


--
-- Name: rhodecode_settings_app_settings_name_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY rhodecode_settings
    ADD CONSTRAINT rhodecode_settings_app_settings_name_key UNIQUE (app_settings_name);


--
-- Name: rhodecode_settings_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY rhodecode_settings
    ADD CONSTRAINT rhodecode_settings_pkey PRIMARY KEY (app_settings_id);


--
-- Name: rhodecode_ui_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY rhodecode_ui
    ADD CONSTRAINT rhodecode_ui_pkey PRIMARY KEY (ui_id);


--
-- Name: rhodecode_ui_ui_key_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY rhodecode_ui
    ADD CONSTRAINT rhodecode_ui_ui_key_key UNIQUE (ui_key);


--
-- Name: statistics_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY statistics
    ADD CONSTRAINT statistics_pkey PRIMARY KEY (stat_id);


--
-- Name: statistics_repository_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY statistics
    ADD CONSTRAINT statistics_repository_id_key UNIQUE (repository_id);


--
-- Name: user_email_map_email_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY user_email_map
    ADD CONSTRAINT user_email_map_email_key UNIQUE (email);


--
-- Name: user_email_map_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY user_email_map
    ADD CONSTRAINT user_email_map_pkey PRIMARY KEY (email_id);


--
-- Name: user_followings_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY user_followings
    ADD CONSTRAINT user_followings_pkey PRIMARY KEY (user_following_id);


--
-- Name: user_followings_user_id_follows_repository_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY user_followings
    ADD CONSTRAINT user_followings_user_id_follows_repository_id_key UNIQUE (user_id, follows_repository_id);


--
-- Name: user_followings_user_id_follows_user_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY user_followings
    ADD CONSTRAINT user_followings_user_id_follows_user_id_key UNIQUE (user_id, follows_user_id);


--
-- Name: user_ip_map_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY user_ip_map
    ADD CONSTRAINT user_ip_map_pkey PRIMARY KEY (ip_id);


--
-- Name: user_ip_map_user_id_ip_addr_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY user_ip_map
    ADD CONSTRAINT user_ip_map_user_id_ip_addr_key UNIQUE (user_id, ip_addr);


--
-- Name: user_logs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY user_logs
    ADD CONSTRAINT user_logs_pkey PRIMARY KEY (user_log_id);


--
-- Name: user_repo_group_to_perm_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY user_repo_group_to_perm
    ADD CONSTRAINT user_repo_group_to_perm_pkey PRIMARY KEY (group_to_perm_id);


--
-- Name: user_repo_group_to_perm_user_id_group_id_permission_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY user_repo_group_to_perm
    ADD CONSTRAINT user_repo_group_to_perm_user_id_group_id_permission_id_key UNIQUE (user_id, group_id, permission_id);


--
-- Name: user_to_notification_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY user_to_notification
    ADD CONSTRAINT user_to_notification_pkey PRIMARY KEY (user_id, notification_id);


--
-- Name: user_to_perm_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY user_to_perm
    ADD CONSTRAINT user_to_perm_pkey PRIMARY KEY (user_to_perm_id);


--
-- Name: user_to_perm_user_id_permission_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY user_to_perm
    ADD CONSTRAINT user_to_perm_user_id_permission_id_key UNIQUE (user_id, permission_id);


--
-- Name: users_group_repo_group_to_perm_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY users_group_repo_group_to_perm
    ADD CONSTRAINT users_group_repo_group_to_perm_pkey PRIMARY KEY (users_group_repo_group_to_perm_id);


--
-- Name: users_group_repo_group_to_perm_users_group_id_group_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY users_group_repo_group_to_perm
    ADD CONSTRAINT users_group_repo_group_to_perm_users_group_id_group_id_key UNIQUE (users_group_id, group_id);


--
-- Name: users_group_repo_to_perm_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY users_group_repo_to_perm
    ADD CONSTRAINT users_group_repo_to_perm_pkey PRIMARY KEY (users_group_to_perm_id);


--
-- Name: users_group_repo_to_perm_repository_id_users_group_id_permi_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY users_group_repo_to_perm
    ADD CONSTRAINT users_group_repo_to_perm_repository_id_users_group_id_permi_key UNIQUE (repository_id, users_group_id, permission_id);


--
-- Name: users_group_to_perm_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY users_group_to_perm
    ADD CONSTRAINT users_group_to_perm_pkey PRIMARY KEY (users_group_to_perm_id);


--
-- Name: users_group_to_perm_users_group_id_permission_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY users_group_to_perm
    ADD CONSTRAINT users_group_to_perm_users_group_id_permission_id_key UNIQUE (users_group_id, permission_id);


--
-- Name: users_groups_members_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY users_groups_members
    ADD CONSTRAINT users_groups_members_pkey PRIMARY KEY (users_group_member_id);


--
-- Name: users_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY users_groups
    ADD CONSTRAINT users_groups_pkey PRIMARY KEY (users_group_id);


--
-- Name: users_groups_users_group_name_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY users_groups
    ADD CONSTRAINT users_groups_users_group_name_key UNIQUE (users_group_name);


--
-- Name: cc_revision_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX cc_revision_idx ON changeset_comments USING btree (revision);


--
-- Name: cs_revision_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX cs_revision_idx ON changeset_statuses USING btree (revision);


--
-- Name: cs_version_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX cs_version_idx ON changeset_statuses USING btree (version);


--
-- Name: key_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX key_idx ON cache_invalidation USING btree (cache_key);


--
-- Name: notification_type_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX notification_type_idx ON notifications USING btree (type);


--
-- Name: p_perm_name_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX p_perm_name_idx ON permissions USING btree (permission_name);


--
-- Name: r_repo_name_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX r_repo_name_idx ON repositories USING btree (repo_name);


--
-- Name: uem_email_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX uem_email_idx ON user_email_map USING btree (email);


--
-- Name: changeset_comments_pull_request_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY changeset_comments
    ADD CONSTRAINT changeset_comments_pull_request_id_fkey FOREIGN KEY (pull_request_id) REFERENCES pull_requests(pull_request_id);


--
-- Name: changeset_comments_repo_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY changeset_comments
    ADD CONSTRAINT changeset_comments_repo_id_fkey FOREIGN KEY (repo_id) REFERENCES repositories(repo_id);


--
-- Name: changeset_comments_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY changeset_comments
    ADD CONSTRAINT changeset_comments_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(user_id);


--
-- Name: changeset_statuses_changeset_comment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY changeset_statuses
    ADD CONSTRAINT changeset_statuses_changeset_comment_id_fkey FOREIGN KEY (changeset_comment_id) REFERENCES changeset_comments(comment_id);


--
-- Name: changeset_statuses_pull_request_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY changeset_statuses
    ADD CONSTRAINT changeset_statuses_pull_request_id_fkey FOREIGN KEY (pull_request_id) REFERENCES pull_requests(pull_request_id);


--
-- Name: changeset_statuses_repo_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY changeset_statuses
    ADD CONSTRAINT changeset_statuses_repo_id_fkey FOREIGN KEY (repo_id) REFERENCES repositories(repo_id);


--
-- Name: changeset_statuses_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY changeset_statuses
    ADD CONSTRAINT changeset_statuses_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(user_id);


--
-- Name: groups_group_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY groups
    ADD CONSTRAINT groups_group_parent_id_fkey FOREIGN KEY (group_parent_id) REFERENCES groups(group_id);


--
-- Name: notifications_created_by_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY notifications
    ADD CONSTRAINT notifications_created_by_fkey FOREIGN KEY (created_by) REFERENCES users(user_id);


--
-- Name: pull_request_reviewers_pull_request_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY pull_request_reviewers
    ADD CONSTRAINT pull_request_reviewers_pull_request_id_fkey FOREIGN KEY (pull_request_id) REFERENCES pull_requests(pull_request_id);


--
-- Name: pull_request_reviewers_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY pull_request_reviewers
    ADD CONSTRAINT pull_request_reviewers_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(user_id);


--
-- Name: pull_requests_org_repo_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY pull_requests
    ADD CONSTRAINT pull_requests_org_repo_id_fkey FOREIGN KEY (org_repo_id) REFERENCES repositories(repo_id);


--
-- Name: pull_requests_other_repo_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY pull_requests
    ADD CONSTRAINT pull_requests_other_repo_id_fkey FOREIGN KEY (other_repo_id) REFERENCES repositories(repo_id);


--
-- Name: pull_requests_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY pull_requests
    ADD CONSTRAINT pull_requests_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(user_id);


--
-- Name: repo_to_perm_permission_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY repo_to_perm
    ADD CONSTRAINT repo_to_perm_permission_id_fkey FOREIGN KEY (permission_id) REFERENCES permissions(permission_id);


--
-- Name: repo_to_perm_repository_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY repo_to_perm
    ADD CONSTRAINT repo_to_perm_repository_id_fkey FOREIGN KEY (repository_id) REFERENCES repositories(repo_id);


--
-- Name: repo_to_perm_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY repo_to_perm
    ADD CONSTRAINT repo_to_perm_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(user_id);


--
-- Name: repositories_fields_repository_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY repositories_fields
    ADD CONSTRAINT repositories_fields_repository_id_fkey FOREIGN KEY (repository_id) REFERENCES repositories(repo_id);


--
-- Name: repositories_fork_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY repositories
    ADD CONSTRAINT repositories_fork_id_fkey FOREIGN KEY (fork_id) REFERENCES repositories(repo_id);


--
-- Name: repositories_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY repositories
    ADD CONSTRAINT repositories_group_id_fkey FOREIGN KEY (group_id) REFERENCES groups(group_id);


--
-- Name: repositories_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY repositories
    ADD CONSTRAINT repositories_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(user_id);


--
-- Name: statistics_repository_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY statistics
    ADD CONSTRAINT statistics_repository_id_fkey FOREIGN KEY (repository_id) REFERENCES repositories(repo_id);


--
-- Name: user_email_map_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY user_email_map
    ADD CONSTRAINT user_email_map_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(user_id);


--
-- Name: user_followings_follows_repository_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY user_followings
    ADD CONSTRAINT user_followings_follows_repository_id_fkey FOREIGN KEY (follows_repository_id) REFERENCES repositories(repo_id);


--
-- Name: user_followings_follows_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY user_followings
    ADD CONSTRAINT user_followings_follows_user_id_fkey FOREIGN KEY (follows_user_id) REFERENCES users(user_id);


--
-- Name: user_followings_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY user_followings
    ADD CONSTRAINT user_followings_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(user_id);


--
-- Name: user_ip_map_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY user_ip_map
    ADD CONSTRAINT user_ip_map_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(user_id);


--
-- Name: user_logs_repository_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY user_logs
    ADD CONSTRAINT user_logs_repository_id_fkey FOREIGN KEY (repository_id) REFERENCES repositories(repo_id);


--
-- Name: user_logs_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY user_logs
    ADD CONSTRAINT user_logs_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(user_id);


--
-- Name: user_repo_group_to_perm_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY user_repo_group_to_perm
    ADD CONSTRAINT user_repo_group_to_perm_group_id_fkey FOREIGN KEY (group_id) REFERENCES groups(group_id);


--
-- Name: user_repo_group_to_perm_permission_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY user_repo_group_to_perm
    ADD CONSTRAINT user_repo_group_to_perm_permission_id_fkey FOREIGN KEY (permission_id) REFERENCES permissions(permission_id);


--
-- Name: user_repo_group_to_perm_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY user_repo_group_to_perm
    ADD CONSTRAINT user_repo_group_to_perm_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(user_id);


--
-- Name: user_to_notification_notification_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY user_to_notification
    ADD CONSTRAINT user_to_notification_notification_id_fkey FOREIGN KEY (notification_id) REFERENCES notifications(notification_id);


--
-- Name: user_to_notification_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY user_to_notification
    ADD CONSTRAINT user_to_notification_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(user_id);


--
-- Name: user_to_perm_permission_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY user_to_perm
    ADD CONSTRAINT user_to_perm_permission_id_fkey FOREIGN KEY (permission_id) REFERENCES permissions(permission_id);


--
-- Name: user_to_perm_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY user_to_perm
    ADD CONSTRAINT user_to_perm_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(user_id);


--
-- Name: users_group_repo_group_to_perm_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY users_group_repo_group_to_perm
    ADD CONSTRAINT users_group_repo_group_to_perm_group_id_fkey FOREIGN KEY (group_id) REFERENCES groups(group_id);


--
-- Name: users_group_repo_group_to_perm_permission_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY users_group_repo_group_to_perm
    ADD CONSTRAINT users_group_repo_group_to_perm_permission_id_fkey FOREIGN KEY (permission_id) REFERENCES permissions(permission_id);


--
-- Name: users_group_repo_group_to_perm_users_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY users_group_repo_group_to_perm
    ADD CONSTRAINT users_group_repo_group_to_perm_users_group_id_fkey FOREIGN KEY (users_group_id) REFERENCES users_groups(users_group_id);


--
-- Name: users_group_repo_to_perm_permission_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY users_group_repo_to_perm
    ADD CONSTRAINT users_group_repo_to_perm_permission_id_fkey FOREIGN KEY (permission_id) REFERENCES permissions(permission_id);


--
-- Name: users_group_repo_to_perm_repository_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY users_group_repo_to_perm
    ADD CONSTRAINT users_group_repo_to_perm_repository_id_fkey FOREIGN KEY (repository_id) REFERENCES repositories(repo_id);


--
-- Name: users_group_repo_to_perm_users_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY users_group_repo_to_perm
    ADD CONSTRAINT users_group_repo_to_perm_users_group_id_fkey FOREIGN KEY (users_group_id) REFERENCES users_groups(users_group_id);


--
-- Name: users_group_to_perm_permission_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY users_group_to_perm
    ADD CONSTRAINT users_group_to_perm_permission_id_fkey FOREIGN KEY (permission_id) REFERENCES permissions(permission_id);


--
-- Name: users_group_to_perm_users_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY users_group_to_perm
    ADD CONSTRAINT users_group_to_perm_users_group_id_fkey FOREIGN KEY (users_group_id) REFERENCES users_groups(users_group_id);


--
-- Name: users_groups_members_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY users_groups_members
    ADD CONSTRAINT users_groups_members_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(user_id);


--
-- Name: users_groups_members_users_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY users_groups_members
    ADD CONSTRAINT users_groups_members_users_group_id_fkey FOREIGN KEY (users_group_id) REFERENCES users_groups(users_group_id);


--
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;


--
--

