-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

-- noinspection SpellCheckingInspectionForFile

--
-- PostgreSQL database dump
--

\restrict V5y7Wgbswasgm7UnGlx0qTGOk52yHGHAWgST3HXveDIktl8Dn0CpNmczwHt70e5

-- Dumped from database version 18.1 (Debian 18.1-1.pgdg13+2)
-- Dumped by pg_dump version 18.1

-- Started on 2026-02-20 14:19:31 GMT

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET transaction_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;

--
-- TOC entry 2 (class 3079 OID 20739)
-- Name: pg_trgm; Type: EXTENSION; Schema: -; Owner: -
--

CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public;


--
-- TOC entry 3624 (class 0 OID 0)
-- Dependencies: 2
-- Name: EXTENSION pg_trgm; Type: COMMENT; Schema: -; Owner: 
--

COMMENT ON EXTENSION pg_trgm IS 'text similarity measurement and index searching based on trigrams';


SET default_tablespace = '';

SET default_table_access_method = heap;

--
-- TOC entry 243 (class 1259 OID 19974)
-- Name: circle_comments; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.circle_comments (
    circle_id bigint NOT NULL,
    comment_id bigint NOT NULL
);


ALTER TABLE public.circle_comments OWNER TO admin;

--
-- TOC entry 245 (class 1259 OID 20821)
-- Name: circle_invites; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.circle_invites (
    id bigint NOT NULL,
    invited_user_id bigint NOT NULL,
    invited_by_user_id bigint NOT NULL
);


ALTER TABLE public.circle_invites OWNER TO admin;

--
-- TOC entry 244 (class 1259 OID 20820)
-- Name: circle_invites_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.circle_invites_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.circle_invites_id_seq OWNER TO admin;

--
-- TOC entry 3658 (class 0 OID 0)
-- Dependencies: 244
-- Name: circle_invites_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.circle_invites_id_seq OWNED BY public.circle_invites.id;


--
-- TOC entry 230 (class 1259 OID 19837)
-- Name: circles; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.circles (
    id bigint NOT NULL,
    name character varying(60) NOT NULL,
    is_public boolean DEFAULT false NOT NULL,
    owning_user_id bigint NOT NULL,
    image_path text,
    colour character(7) DEFAULT '#71677C'::bpchar NOT NULL
);


ALTER TABLE public.circles OWNER TO admin;

--
-- TOC entry 229 (class 1259 OID 19836)
-- Name: circles_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.circles_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.circles_id_seq OWNER TO admin;

--
-- TOC entry 3661 (class 0 OID 0)
-- Dependencies: 229
-- Name: circles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.circles_id_seq OWNED BY public.circles.id;


--
-- TOC entry 225 (class 1259 OID 16431)
-- Name: claims; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.claims (
    id bigint NOT NULL,
    name character varying(60) NOT NULL,
    is_default boolean DEFAULT false NOT NULL
);


ALTER TABLE public.claims OWNER TO admin;

--
-- TOC entry 224 (class 1259 OID 16430)
-- Name: claims_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.claims_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.claims_id_seq OWNER TO admin;

--
-- TOC entry 3664 (class 0 OID 0)
-- Dependencies: 224
-- Name: claims_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.claims_id_seq OWNED BY public.claims.id;


--
-- TOC entry 239 (class 1259 OID 19919)
-- Name: collection_games; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.collection_games (
    collection_id bigint NOT NULL,
    game_id bigint NOT NULL
);


ALTER TABLE public.collection_games OWNER TO admin;

--
-- TOC entry 238 (class 1259 OID 19905)
-- Name: collections; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.collections (
    id bigint NOT NULL,
    user_id bigint NOT NULL,
    name character varying(60) NOT NULL
);


ALTER TABLE public.collections OWNER TO admin;

--
-- TOC entry 237 (class 1259 OID 19904)
-- Name: collections_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.collections_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.collections_id_seq OWNER TO admin;

--
-- TOC entry 3668 (class 0 OID 0)
-- Dependencies: 237
-- Name: collections_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.collections_id_seq OWNED BY public.collections.id;


--
-- TOC entry 241 (class 1259 OID 19940)
-- Name: comments; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.comments (
    id bigint NOT NULL,
    created_by_user_id bigint NOT NULL,
    created_at timestamp(6) with time zone DEFAULT now() NOT NULL,
    content text NOT NULL
);


ALTER TABLE public.comments OWNER TO admin;

--
-- TOC entry 240 (class 1259 OID 19939)
-- Name: comments_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.comments_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.comments_id_seq OWNER TO admin;

--
-- TOC entry 3671 (class 0 OID 0)
-- Dependencies: 240
-- Name: comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.comments_id_seq OWNED BY public.comments.id;


--
-- TOC entry 232 (class 1259 OID 19848)
-- Name: games; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.games (
    id bigint NOT NULL,
    name character varying(60) CONSTRAINT games_names_not_null NOT NULL,
    image_path text,
    bgg_id bigint
);


ALTER TABLE public.games OWNER TO admin;

--
-- TOC entry 231 (class 1259 OID 19847)
-- Name: games_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.games_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.games_id_seq OWNER TO admin;

--
-- TOC entry 3674 (class 0 OID 0)
-- Dependencies: 231
-- Name: games_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.games_id_seq OWNED BY public.games.id;


--
-- TOC entry 242 (class 1259 OID 19959)
-- Name: match_comments; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.match_comments (
    match_id bigint NOT NULL,
    comment_id bigint NOT NULL
);


ALTER TABLE public.match_comments OWNER TO admin;

--
-- TOC entry 235 (class 1259 OID 19872)
-- Name: match_players; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.match_players (
    match_id bigint NOT NULL,
    player_id bigint NOT NULL,
    standing integer NOT NULL,
    elo_change integer NOT NULL
);


ALTER TABLE public.match_players OWNER TO admin;

--
-- TOC entry 234 (class 1259 OID 19859)
-- Name: matches; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.matches (
    id bigint NOT NULL,
    game_id bigint NOT NULL,
    owning_user_id bigint NOT NULL
);


ALTER TABLE public.matches OWNER TO admin;

--
-- TOC entry 233 (class 1259 OID 19858)
-- Name: matches_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.matches_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.matches_id_seq OWNER TO admin;

--
-- TOC entry 3679 (class 0 OID 0)
-- Dependencies: 233
-- Name: matches_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.matches_id_seq OWNED BY public.matches.id;


--
-- TOC entry 236 (class 1259 OID 19889)
-- Name: player_circles; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.player_circles (
    player_id bigint NOT NULL,
    circle_id bigint NOT NULL
);


ALTER TABLE public.player_circles OWNER TO admin;

--
-- TOC entry 228 (class 1259 OID 19809)
-- Name: players; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.players (
    id bigint NOT NULL,
    name text NOT NULL,
    elo integer DEFAULT 1000 NOT NULL,
    is_rating_locked boolean DEFAULT false NOT NULL,
    can_be_multiple boolean DEFAULT false NOT NULL
);


ALTER TABLE public.players OWNER TO admin;

--
-- TOC entry 227 (class 1259 OID 19808)
-- Name: players_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.players_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.players_id_seq OWNER TO admin;

--
-- TOC entry 3683 (class 0 OID 0)
-- Dependencies: 227
-- Name: players_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.players_id_seq OWNED BY public.players.id;


--
-- TOC entry 247 (class 1259 OID 20841)
-- Name: userInvites; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public."userInvites" (
    id bigint NOT NULL,
    invite_code character varying(6) NOT NULL,
    email text NOT NULL,
    player_id bigint NOT NULL,
    invited_by_user_id bigint NOT NULL,
    was_email_sent boolean DEFAULT false NOT NULL,
    created_at timestamp(6) with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public."userInvites" OWNER TO admin;

--
-- TOC entry 246 (class 1259 OID 20840)
-- Name: userInvites_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public."userInvites_id_seq"
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public."userInvites_id_seq" OWNER TO admin;

--
-- TOC entry 3685 (class 0 OID 0)
-- Dependencies: 246
-- Name: userInvites_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public."userInvites_id_seq" OWNED BY public."userInvites".id;


--
-- TOC entry 226 (class 1259 OID 16439)
-- Name: user_claims; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.user_claims (
    user_id bigint,
    claim_id integer
);


ALTER TABLE public.user_claims OWNER TO admin;

--
-- TOC entry 223 (class 1259 OID 16392)
-- Name: users; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.users (
    id bigint NOT NULL,
    email character varying(100) CONSTRAINT users_username_not_null NOT NULL,
    pass_hash text NOT NULL,
    is_active boolean DEFAULT true CONSTRAINT users_active_not_null NOT NULL,
    is_admin boolean DEFAULT false NOT NULL,
    player_id bigint NOT NULL,
    failed_attempts integer DEFAULT 0 NOT NULL,
    last_login_attempt date,
    require_new_password boolean DEFAULT false NOT NULL,
    refresh_count bigint DEFAULT 0 NOT NULL
);


ALTER TABLE public.users OWNER TO admin;

--
-- TOC entry 220 (class 1259 OID 16389)
-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.users_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.users_id_seq OWNER TO admin;

--
-- TOC entry 3688 (class 0 OID 0)
-- Dependencies: 220
-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;


--
-- TOC entry 222 (class 1259 OID 16391)
-- Name: users_pass_hash_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.users_pass_hash_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.users_pass_hash_seq OWNER TO admin;

--
-- TOC entry 3690 (class 0 OID 0)
-- Dependencies: 222
-- Name: users_pass_hash_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.users_pass_hash_seq OWNED BY public.users.pass_hash;


--
-- TOC entry 221 (class 1259 OID 16390)
-- Name: users_username_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.users_username_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.users_username_seq OWNER TO admin;

--
-- TOC entry 3692 (class 0 OID 0)
-- Dependencies: 221
-- Name: users_username_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.users_username_seq OWNED BY public.users.email;


--
-- TOC entry 3428 (class 2604 OID 20824)
-- Name: circle_invites id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.circle_invites ALTER COLUMN id SET DEFAULT nextval('public.circle_invites_id_seq'::regclass);


--
-- TOC entry 3420 (class 2604 OID 19840)
-- Name: circles id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.circles ALTER COLUMN id SET DEFAULT nextval('public.circles_id_seq'::regclass);


--
-- TOC entry 3414 (class 2604 OID 20726)
-- Name: claims id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.claims ALTER COLUMN id SET DEFAULT nextval('public.claims_id_seq'::regclass);


--
-- TOC entry 3425 (class 2604 OID 19908)
-- Name: collections id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.collections ALTER COLUMN id SET DEFAULT nextval('public.collections_id_seq'::regclass);


--
-- TOC entry 3426 (class 2604 OID 19943)
-- Name: comments id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.comments ALTER COLUMN id SET DEFAULT nextval('public.comments_id_seq'::regclass);


--
-- TOC entry 3423 (class 2604 OID 19851)
-- Name: games id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.games ALTER COLUMN id SET DEFAULT nextval('public.games_id_seq'::regclass);


--
-- TOC entry 3424 (class 2604 OID 19862)
-- Name: matches id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.matches ALTER COLUMN id SET DEFAULT nextval('public.matches_id_seq'::regclass);


--
-- TOC entry 3416 (class 2604 OID 19812)
-- Name: players id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.players ALTER COLUMN id SET DEFAULT nextval('public.players_id_seq'::regclass);


--
-- TOC entry 3429 (class 2604 OID 20844)
-- Name: userInvites id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public."userInvites" ALTER COLUMN id SET DEFAULT nextval('public."userInvites_id_seq"'::regclass);


--
-- TOC entry 3408 (class 2604 OID 16395)
-- Name: users id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass);


--
-- TOC entry 3449 (class 2606 OID 20829)
-- Name: circle_invites circle_invites_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.circle_invites
    ADD CONSTRAINT circle_invites_pkey PRIMARY KEY (id);


--
-- TOC entry 3439 (class 2606 OID 19846)
-- Name: circles circles_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.circles
    ADD CONSTRAINT circles_pkey PRIMARY KEY (id);


--
-- TOC entry 3435 (class 2606 OID 20728)
-- Name: claims claims_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.claims
    ADD CONSTRAINT claims_pkey PRIMARY KEY (id);


--
-- TOC entry 3445 (class 2606 OID 19913)
-- Name: collections collections_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.collections
    ADD CONSTRAINT collections_pkey PRIMARY KEY (id);


--
-- TOC entry 3447 (class 2606 OID 19952)
-- Name: comments comments_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.comments
    ADD CONSTRAINT comments_pkey PRIMARY KEY (id);


--
-- TOC entry 3441 (class 2606 OID 19857)
-- Name: games games_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.games
    ADD CONSTRAINT games_pkey PRIMARY KEY (id);


--
-- TOC entry 3443 (class 2606 OID 19866)
-- Name: matches matches_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.matches
    ADD CONSTRAINT matches_pkey PRIMARY KEY (id);


--
-- TOC entry 3437 (class 2606 OID 19824)
-- Name: players players_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.players
    ADD CONSTRAINT players_pkey PRIMARY KEY (id);


--
-- TOC entry 3451 (class 2606 OID 20857)
-- Name: userInvites userInvites_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public."userInvites"
    ADD CONSTRAINT "userInvites_pkey" PRIMARY KEY (id);


--
-- TOC entry 3433 (class 2606 OID 16403)
-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.users
    ADD CONSTRAINT users_pkey PRIMARY KEY (id);


--
-- TOC entry 3468 (class 2606 OID 19979)
-- Name: circle_comments circle_comments_circles_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.circle_comments
    ADD CONSTRAINT circle_comments_circles_fkey FOREIGN KEY (circle_id) REFERENCES public.circles(id);


--
-- TOC entry 3469 (class 2606 OID 19984)
-- Name: circle_comments circle_comments_comment_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.circle_comments
    ADD CONSTRAINT circle_comments_comment_fkey FOREIGN KEY (comment_id) REFERENCES public.comments(id);


--
-- TOC entry 3470 (class 2606 OID 20835)
-- Name: circle_invites circle_invites_invited_by_user_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.circle_invites
    ADD CONSTRAINT circle_invites_invited_by_user_fkey FOREIGN KEY (invited_by_user_id) REFERENCES public.users(id);


--
-- TOC entry 3471 (class 2606 OID 20830)
-- Name: circle_invites circle_invites_invited_user_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.circle_invites
    ADD CONSTRAINT circle_invites_invited_user_fkey FOREIGN KEY (invited_user_id) REFERENCES public.users(id);


--
-- TOC entry 3455 (class 2606 OID 20708)
-- Name: circles circles_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.circles
    ADD CONSTRAINT circles_users_fkey FOREIGN KEY (owning_user_id) REFERENCES public.users(id) NOT VALID;


--
-- TOC entry 3463 (class 2606 OID 19924)
-- Name: collection_games collection_games_collections_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.collection_games
    ADD CONSTRAINT collection_games_collections_fkey FOREIGN KEY (collection_id) REFERENCES public.collections(id);


--
-- TOC entry 3464 (class 2606 OID 19929)
-- Name: collection_games collection_games_games_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.collection_games
    ADD CONSTRAINT collection_games_games_fkey FOREIGN KEY (game_id) REFERENCES public.games(id);


--
-- TOC entry 3462 (class 2606 OID 19914)
-- Name: collections collections_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.collections
    ADD CONSTRAINT collections_users_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);


--
-- TOC entry 3465 (class 2606 OID 19953)
-- Name: comments comments_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.comments
    ADD CONSTRAINT comments_users_fkey FOREIGN KEY (created_by_user_id) REFERENCES public.users(id);


--
-- TOC entry 3466 (class 2606 OID 19969)
-- Name: match_comments match_comments_comments_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.match_comments
    ADD CONSTRAINT match_comments_comments_fkey FOREIGN KEY (comment_id) REFERENCES public.comments(id);


--
-- TOC entry 3467 (class 2606 OID 19964)
-- Name: match_comments match_comments_matches_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.match_comments
    ADD CONSTRAINT match_comments_matches_fkey FOREIGN KEY (match_id) REFERENCES public.matches(id);


--
-- TOC entry 3458 (class 2606 OID 19884)
-- Name: match_players match_players_matches_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.match_players
    ADD CONSTRAINT match_players_matches_fkey FOREIGN KEY (match_id) REFERENCES public.matches(id);


--
-- TOC entry 3459 (class 2606 OID 19879)
-- Name: match_players match_players_players_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.match_players
    ADD CONSTRAINT match_players_players_fkey FOREIGN KEY (player_id) REFERENCES public.players(id);


--
-- TOC entry 3456 (class 2606 OID 19867)
-- Name: matches matches_games_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.matches
    ADD CONSTRAINT matches_games_fkey FOREIGN KEY (game_id) REFERENCES public.games(id);


--
-- TOC entry 3457 (class 2606 OID 20721)
-- Name: matches matches_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.matches
    ADD CONSTRAINT matches_users_fkey FOREIGN KEY (owning_user_id) REFERENCES public.users(id) NOT VALID;


--
-- TOC entry 3460 (class 2606 OID 19899)
-- Name: player_circles player_circles_circles_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.player_circles
    ADD CONSTRAINT player_circles_circles_fkey FOREIGN KEY (circle_id) REFERENCES public.circles(id);


--
-- TOC entry 3461 (class 2606 OID 19894)
-- Name: player_circles player_circles_players_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.player_circles
    ADD CONSTRAINT player_circles_players_fkey FOREIGN KEY (player_id) REFERENCES public.players(id);


--
-- TOC entry 3453 (class 2606 OID 20730)
-- Name: user_claims user_claims_claimid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.user_claims
    ADD CONSTRAINT user_claims_claimid_fkey FOREIGN KEY (claim_id) REFERENCES public.claims(id);


--
-- TOC entry 3454 (class 2606 OID 16442)
-- Name: user_claims user_claims_userid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.user_claims
    ADD CONSTRAINT user_claims_userid_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);


--
-- TOC entry 3452 (class 2606 OID 19830)
-- Name: users users_players_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.users
    ADD CONSTRAINT users_players_fkey FOREIGN KEY (player_id) REFERENCES public.players(id) NOT VALID;


--
-- TOC entry 3625 (class 0 OID 0)
-- Dependencies: 257
-- Name: FUNCTION gtrgm_in(cstring); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.gtrgm_in(cstring) TO "ApiUser";


--
-- TOC entry 3626 (class 0 OID 0)
-- Dependencies: 258
-- Name: FUNCTION gtrgm_out(public.gtrgm); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.gtrgm_out(public.gtrgm) TO "ApiUser";


--
-- TOC entry 3627 (class 0 OID 0)
-- Dependencies: 249
-- Name: FUNCTION gin_extract_query_trgm(text, internal, smallint, internal, internal, internal, internal); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.gin_extract_query_trgm(text, internal, smallint, internal, internal, internal, internal) TO "ApiUser";


--
-- TOC entry 3628 (class 0 OID 0)
-- Dependencies: 250
-- Name: FUNCTION gin_extract_value_trgm(text, internal); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.gin_extract_value_trgm(text, internal) TO "ApiUser";


--
-- TOC entry 3629 (class 0 OID 0)
-- Dependencies: 251
-- Name: FUNCTION gin_trgm_consistent(internal, smallint, text, integer, internal, internal, internal, internal); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.gin_trgm_consistent(internal, smallint, text, integer, internal, internal, internal, internal) TO "ApiUser";


--
-- TOC entry 3630 (class 0 OID 0)
-- Dependencies: 252
-- Name: FUNCTION gin_trgm_triconsistent(internal, smallint, text, integer, internal, internal, internal); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.gin_trgm_triconsistent(internal, smallint, text, integer, internal, internal, internal) TO "ApiUser";


--
-- TOC entry 3631 (class 0 OID 0)
-- Dependencies: 253
-- Name: FUNCTION gtrgm_compress(internal); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.gtrgm_compress(internal) TO "ApiUser";


--
-- TOC entry 3632 (class 0 OID 0)
-- Dependencies: 254
-- Name: FUNCTION gtrgm_consistent(internal, text, smallint, oid, internal); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.gtrgm_consistent(internal, text, smallint, oid, internal) TO "ApiUser";


--
-- TOC entry 3633 (class 0 OID 0)
-- Dependencies: 255
-- Name: FUNCTION gtrgm_decompress(internal); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.gtrgm_decompress(internal) TO "ApiUser";


--
-- TOC entry 3634 (class 0 OID 0)
-- Dependencies: 256
-- Name: FUNCTION gtrgm_distance(internal, text, smallint, oid, internal); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.gtrgm_distance(internal, text, smallint, oid, internal) TO "ApiUser";


--
-- TOC entry 3635 (class 0 OID 0)
-- Dependencies: 248
-- Name: FUNCTION gtrgm_options(internal); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.gtrgm_options(internal) TO "ApiUser";


--
-- TOC entry 3636 (class 0 OID 0)
-- Dependencies: 259
-- Name: FUNCTION gtrgm_penalty(internal, internal, internal); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.gtrgm_penalty(internal, internal, internal) TO "ApiUser";


--
-- TOC entry 3637 (class 0 OID 0)
-- Dependencies: 260
-- Name: FUNCTION gtrgm_picksplit(internal, internal); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.gtrgm_picksplit(internal, internal) TO "ApiUser";


--
-- TOC entry 3638 (class 0 OID 0)
-- Dependencies: 261
-- Name: FUNCTION gtrgm_same(public.gtrgm, public.gtrgm, internal); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.gtrgm_same(public.gtrgm, public.gtrgm, internal) TO "ApiUser";


--
-- TOC entry 3639 (class 0 OID 0)
-- Dependencies: 262
-- Name: FUNCTION gtrgm_union(internal, internal); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.gtrgm_union(internal, internal) TO "ApiUser";


--
-- TOC entry 3640 (class 0 OID 0)
-- Dependencies: 263
-- Name: FUNCTION set_limit(real); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.set_limit(real) TO "ApiUser";


--
-- TOC entry 3641 (class 0 OID 0)
-- Dependencies: 264
-- Name: FUNCTION show_limit(); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.show_limit() TO "ApiUser";


--
-- TOC entry 3642 (class 0 OID 0)
-- Dependencies: 265
-- Name: FUNCTION show_trgm(text); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.show_trgm(text) TO "ApiUser";


--
-- TOC entry 3643 (class 0 OID 0)
-- Dependencies: 266
-- Name: FUNCTION similarity(text, text); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.similarity(text, text) TO "ApiUser";


--
-- TOC entry 3644 (class 0 OID 0)
-- Dependencies: 267
-- Name: FUNCTION similarity_dist(text, text); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.similarity_dist(text, text) TO "ApiUser";


--
-- TOC entry 3645 (class 0 OID 0)
-- Dependencies: 268
-- Name: FUNCTION similarity_op(text, text); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.similarity_op(text, text) TO "ApiUser";


--
-- TOC entry 3646 (class 0 OID 0)
-- Dependencies: 269
-- Name: FUNCTION strict_word_similarity(text, text); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.strict_word_similarity(text, text) TO "ApiUser";


--
-- TOC entry 3647 (class 0 OID 0)
-- Dependencies: 270
-- Name: FUNCTION strict_word_similarity_commutator_op(text, text); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.strict_word_similarity_commutator_op(text, text) TO "ApiUser";


--
-- TOC entry 3648 (class 0 OID 0)
-- Dependencies: 271
-- Name: FUNCTION strict_word_similarity_dist_commutator_op(text, text); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.strict_word_similarity_dist_commutator_op(text, text) TO "ApiUser";


--
-- TOC entry 3649 (class 0 OID 0)
-- Dependencies: 272
-- Name: FUNCTION strict_word_similarity_dist_op(text, text); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.strict_word_similarity_dist_op(text, text) TO "ApiUser";


--
-- TOC entry 3650 (class 0 OID 0)
-- Dependencies: 273
-- Name: FUNCTION strict_word_similarity_op(text, text); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.strict_word_similarity_op(text, text) TO "ApiUser";


--
-- TOC entry 3651 (class 0 OID 0)
-- Dependencies: 274
-- Name: FUNCTION word_similarity(text, text); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.word_similarity(text, text) TO "ApiUser";


--
-- TOC entry 3652 (class 0 OID 0)
-- Dependencies: 275
-- Name: FUNCTION word_similarity_commutator_op(text, text); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.word_similarity_commutator_op(text, text) TO "ApiUser";


--
-- TOC entry 3653 (class 0 OID 0)
-- Dependencies: 276
-- Name: FUNCTION word_similarity_dist_commutator_op(text, text); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.word_similarity_dist_commutator_op(text, text) TO "ApiUser";


--
-- TOC entry 3654 (class 0 OID 0)
-- Dependencies: 277
-- Name: FUNCTION word_similarity_dist_op(text, text); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.word_similarity_dist_op(text, text) TO "ApiUser";


--
-- TOC entry 3655 (class 0 OID 0)
-- Dependencies: 278
-- Name: FUNCTION word_similarity_op(text, text); Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON FUNCTION public.word_similarity_op(text, text) TO "ApiUser";


--
-- TOC entry 3656 (class 0 OID 0)
-- Dependencies: 243
-- Name: TABLE circle_comments; Type: ACL; Schema: public; Owner: admin
--

GRANT SELECT,INSERT,DELETE,TRIGGER,UPDATE ON TABLE public.circle_comments TO "ApiUser";


--
-- TOC entry 3657 (class 0 OID 0)
-- Dependencies: 245
-- Name: TABLE circle_invites; Type: ACL; Schema: public; Owner: admin
--

GRANT SELECT,INSERT,DELETE,TRIGGER,UPDATE ON TABLE public.circle_invites TO "ApiUser";


--
-- TOC entry 3659 (class 0 OID 0)
-- Dependencies: 244
-- Name: SEQUENCE circle_invites_id_seq; Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON SEQUENCE public.circle_invites_id_seq TO "ApiUser";


--
-- TOC entry 3660 (class 0 OID 0)
-- Dependencies: 230
-- Name: TABLE circles; Type: ACL; Schema: public; Owner: admin
--

GRANT SELECT,INSERT,DELETE,TRIGGER,UPDATE ON TABLE public.circles TO "ApiUser";


--
-- TOC entry 3662 (class 0 OID 0)
-- Dependencies: 229
-- Name: SEQUENCE circles_id_seq; Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON SEQUENCE public.circles_id_seq TO "ApiUser";


--
-- TOC entry 3663 (class 0 OID 0)
-- Dependencies: 225
-- Name: TABLE claims; Type: ACL; Schema: public; Owner: admin
--

GRANT SELECT,INSERT,DELETE,TRIGGER,UPDATE ON TABLE public.claims TO "ApiUser";


--
-- TOC entry 3665 (class 0 OID 0)
-- Dependencies: 224
-- Name: SEQUENCE claims_id_seq; Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON SEQUENCE public.claims_id_seq TO "ApiUser";


--
-- TOC entry 3666 (class 0 OID 0)
-- Dependencies: 239
-- Name: TABLE collection_games; Type: ACL; Schema: public; Owner: admin
--

GRANT SELECT,INSERT,DELETE,TRIGGER,UPDATE ON TABLE public.collection_games TO "ApiUser";


--
-- TOC entry 3667 (class 0 OID 0)
-- Dependencies: 238
-- Name: TABLE collections; Type: ACL; Schema: public; Owner: admin
--

GRANT SELECT,INSERT,DELETE,TRIGGER,UPDATE ON TABLE public.collections TO "ApiUser";


--
-- TOC entry 3669 (class 0 OID 0)
-- Dependencies: 237
-- Name: SEQUENCE collections_id_seq; Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON SEQUENCE public.collections_id_seq TO "ApiUser";


--
-- TOC entry 3670 (class 0 OID 0)
-- Dependencies: 241
-- Name: TABLE comments; Type: ACL; Schema: public; Owner: admin
--

GRANT SELECT,INSERT,DELETE,TRIGGER,UPDATE ON TABLE public.comments TO "ApiUser";


--
-- TOC entry 3672 (class 0 OID 0)
-- Dependencies: 240
-- Name: SEQUENCE comments_id_seq; Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON SEQUENCE public.comments_id_seq TO "ApiUser";


--
-- TOC entry 3673 (class 0 OID 0)
-- Dependencies: 232
-- Name: TABLE games; Type: ACL; Schema: public; Owner: admin
--

GRANT SELECT,INSERT,DELETE,TRIGGER,UPDATE ON TABLE public.games TO "ApiUser";


--
-- TOC entry 3675 (class 0 OID 0)
-- Dependencies: 231
-- Name: SEQUENCE games_id_seq; Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON SEQUENCE public.games_id_seq TO "ApiUser";


--
-- TOC entry 3676 (class 0 OID 0)
-- Dependencies: 242
-- Name: TABLE match_comments; Type: ACL; Schema: public; Owner: admin
--

GRANT SELECT,INSERT,DELETE,TRIGGER,UPDATE ON TABLE public.match_comments TO "ApiUser";


--
-- TOC entry 3677 (class 0 OID 0)
-- Dependencies: 235
-- Name: TABLE match_players; Type: ACL; Schema: public; Owner: admin
--

GRANT SELECT,INSERT,DELETE,TRIGGER,UPDATE ON TABLE public.match_players TO "ApiUser";


--
-- TOC entry 3678 (class 0 OID 0)
-- Dependencies: 234
-- Name: TABLE matches; Type: ACL; Schema: public; Owner: admin
--

GRANT SELECT,INSERT,DELETE,TRIGGER,UPDATE ON TABLE public.matches TO "ApiUser";


--
-- TOC entry 3680 (class 0 OID 0)
-- Dependencies: 233
-- Name: SEQUENCE matches_id_seq; Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON SEQUENCE public.matches_id_seq TO "ApiUser";


--
-- TOC entry 3681 (class 0 OID 0)
-- Dependencies: 236
-- Name: TABLE player_circles; Type: ACL; Schema: public; Owner: admin
--

GRANT SELECT,INSERT,DELETE,TRIGGER,UPDATE ON TABLE public.player_circles TO "ApiUser";


--
-- TOC entry 3682 (class 0 OID 0)
-- Dependencies: 228
-- Name: TABLE players; Type: ACL; Schema: public; Owner: admin
--

GRANT SELECT,INSERT,DELETE,TRIGGER,UPDATE ON TABLE public.players TO "ApiUser";


--
-- TOC entry 3684 (class 0 OID 0)
-- Dependencies: 227
-- Name: SEQUENCE players_id_seq; Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON SEQUENCE public.players_id_seq TO "ApiUser";


--
-- TOC entry 3686 (class 0 OID 0)
-- Dependencies: 226
-- Name: TABLE user_claims; Type: ACL; Schema: public; Owner: admin
--

GRANT SELECT,INSERT,DELETE,TRIGGER,UPDATE ON TABLE public.user_claims TO "ApiUser";


--
-- TOC entry 3687 (class 0 OID 0)
-- Dependencies: 223
-- Name: TABLE users; Type: ACL; Schema: public; Owner: admin
--

GRANT SELECT,INSERT,DELETE,TRIGGER,UPDATE ON TABLE public.users TO "ApiUser";


--
-- TOC entry 3689 (class 0 OID 0)
-- Dependencies: 220
-- Name: SEQUENCE users_id_seq; Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON SEQUENCE public.users_id_seq TO "ApiUser";


--
-- TOC entry 3691 (class 0 OID 0)
-- Dependencies: 222
-- Name: SEQUENCE users_pass_hash_seq; Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON SEQUENCE public.users_pass_hash_seq TO "ApiUser";


--
-- TOC entry 3693 (class 0 OID 0)
-- Dependencies: 221
-- Name: SEQUENCE users_username_seq; Type: ACL; Schema: public; Owner: admin
--

GRANT ALL ON SEQUENCE public.users_username_seq TO "ApiUser";


-- Completed on 2026-02-20 14:19:32 GMT

--
-- PostgreSQL database dump complete
--

\unrestrict V5y7Wgbswasgm7UnGlx0qTGOk52yHGHAWgST3HXveDIktl8Dn0CpNmczwHt70e5

