--
-- PostgreSQL database dump
--

-- Dumped from database version 12.1
-- Dumped by pg_dump version 12.1

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

SET default_tablespace = '';

SET default_table_access_method = heap;

--
-- Name: character; Type: TABLE; Schema: public; Owner: rpfw-dev
--

CREATE TABLE public."character" (
    id integer NOT NULL,
    user_id integer NOT NULL,
    name character varying(24) NOT NULL,
    skin_id smallint DEFAULT 134 NOT NULL,
    cash integer DEFAULT 0,
    health real DEFAULT 100,
    armour real DEFAULT 100,
    jailed smallint DEFAULT 0,
    pos_x real DEFAULT '-144.0328'::numeric,
    pos_y real DEFAULT 1225.0564,
    pos_z real DEFAULT 19.8992,
    rotation real DEFAULT 175.5507,
    created timestamp without time zone DEFAULT (now())::timestamp without time zone
);


ALTER TABLE public."character" OWNER TO "rpfw-dev";

--
-- Name: TABLE "character"; Type: COMMENT; Schema: public; Owner: rpfw-dev
--

COMMENT ON TABLE public."character" IS 'A character of a user. A user can have multiple characters, limited in the game-mode by the charaterArray size, which is set to the definition MAX_CHARACTERS_PER_USER in the game-mode limits section.';


--
-- Name: COLUMN "character".jailed; Type: COMMENT; Schema: public; Owner: rpfw-dev
--

COMMENT ON COLUMN public."character".jailed IS 'Amount of minutes jailed.
TODO Move to own table for criminal database';


--
-- Name: character_character_id_seq; Type: SEQUENCE; Schema: public; Owner: rpfw-dev
--

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


ALTER TABLE public.character_character_id_seq OWNER TO "rpfw-dev";

--
-- Name: character_id_seq; Type: SEQUENCE; Schema: public; Owner: rpfw-dev
--

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


ALTER TABLE public.character_id_seq OWNER TO "rpfw-dev";

--
-- Name: character_id_seq1; Type: SEQUENCE; Schema: public; Owner: rpfw-dev
--

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


ALTER TABLE public.character_id_seq1 OWNER TO "rpfw-dev";

--
-- Name: character_id_seq1; Type: SEQUENCE OWNED BY; Schema: public; Owner: rpfw-dev
--

ALTER SEQUENCE public.character_id_seq1 OWNED BY public."character".id;


--
-- Name: ip; Type: TABLE; Schema: public; Owner: rpfw-dev
--

CREATE TABLE public.ip (
    id integer NOT NULL,
    address character varying(45) NOT NULL,
    connections integer DEFAULT 1
);


ALTER TABLE public.ip OWNER TO "rpfw-dev";

--
-- Name: COLUMN ip.address; Type: COMMENT; Schema: public; Owner: rpfw-dev
--

COMMENT ON COLUMN public.ip.address IS 'Even though sa-mp only seems to support IPv4.
It''s not likely to be updated, but if so, the database is ready for the "future".';


--
-- Name: ip_ban; Type: TABLE; Schema: public; Owner: rpfw-dev
--

CREATE TABLE public.ip_ban (
    id integer NOT NULL,
    ip_id integer NOT NULL,
    created timestamp without time zone DEFAULT (now())::timestamp without time zone,
    expires timestamp without time zone DEFAULT ((now())::timestamp without time zone + '30 days'::interval),
    reason character varying(121) NOT NULL,
    banner_id integer
);


ALTER TABLE public.ip_ban OWNER TO "rpfw-dev";

--
-- Name: TABLE ip_ban; Type: COMMENT; Schema: public; Owner: rpfw-dev
--

COMMENT ON TABLE public.ip_ban IS 'Ban records per IP.
Historic bans are kept for administrative purposes & active bans are checked against timestamp.';


--
-- Name: COLUMN ip_ban.reason; Type: COMMENT; Schema: public; Owner: rpfw-dev
--

COMMENT ON COLUMN public.ip_ban.reason IS 'Maximum sa-mp message length = 128.
The shortest possible ban command is "/ban 0 ". (7 characters)
128 - 7 = 121 as maximum ban reason.';


--
-- Name: ip_bans_id_seq; Type: SEQUENCE; Schema: public; Owner: rpfw-dev
--

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


ALTER TABLE public.ip_bans_id_seq OWNER TO "rpfw-dev";

--
-- Name: ip_bans_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: rpfw-dev
--

ALTER SEQUENCE public.ip_bans_id_seq OWNED BY public.ip_ban.id;


--
-- Name: ip_id_seq; Type: SEQUENCE; Schema: public; Owner: rpfw-dev
--

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


ALTER TABLE public.ip_id_seq OWNER TO "rpfw-dev";

--
-- Name: ip_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: rpfw-dev
--

ALTER SEQUENCE public.ip_id_seq OWNED BY public.ip.id;


--
-- Name: ip_ip_id_seq; Type: SEQUENCE; Schema: public; Owner: rpfw-dev
--

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


ALTER TABLE public.ip_ip_id_seq OWNER TO "rpfw-dev";

--
-- Name: ip_kick; Type: TABLE; Schema: public; Owner: rpfw-dev
--

CREATE TABLE public.ip_kick (
    id integer NOT NULL,
    ip_id integer NOT NULL,
    created timestamp without time zone DEFAULT (now())::timestamp without time zone NOT NULL,
    reason character varying(121) NOT NULL,
    kicker_id integer NOT NULL
);


ALTER TABLE public.ip_kick OWNER TO "rpfw-dev";

--
-- Name: ip_kick_id_seq; Type: SEQUENCE; Schema: public; Owner: rpfw-dev
--

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


ALTER TABLE public.ip_kick_id_seq OWNER TO "rpfw-dev";

--
-- Name: ip_kick_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: rpfw-dev
--

ALTER SEQUENCE public.ip_kick_id_seq OWNED BY public.ip_kick.id;


--
-- Name: user; Type: TABLE; Schema: public; Owner: rpfw-dev
--

CREATE TABLE public."user" (
    id integer NOT NULL,
    name character varying(24) NOT NULL,
    level smallint DEFAULT 1,
    password character varying(128) NOT NULL,
    webaccount_id integer,
    jailed smallint DEFAULT 0,
    created timestamp without time zone DEFAULT (now())::timestamp without time zone
);


ALTER TABLE public."user" OWNER TO "rpfw-dev";

--
-- Name: TABLE "user"; Type: COMMENT; Schema: public; Owner: rpfw-dev
--

COMMENT ON TABLE public."user" IS 'SA-MP player user records';


--
-- Name: user_ban; Type: TABLE; Schema: public; Owner: rpfw-dev
--

CREATE TABLE public.user_ban (
    id integer NOT NULL,
    user_id integer NOT NULL,
    created timestamp without time zone DEFAULT (now())::timestamp without time zone,
    expires timestamp without time zone DEFAULT ((now())::timestamp without time zone + '30 days'::interval),
    reason character varying(121) NOT NULL,
    banner integer,
    ip_ban_id integer NOT NULL
);


ALTER TABLE public.user_ban OWNER TO "rpfw-dev";

--
-- Name: COLUMN user_ban.banner; Type: COMMENT; Schema: public; Owner: rpfw-dev
--

COMMENT ON COLUMN public.user_ban.banner IS 'NOT NULL as users can be banned by automation as well as ingame players.';


--
-- Name: COLUMN user_ban.ip_ban_id; Type: COMMENT; Schema: public; Owner: rpfw-dev
--

COMMENT ON COLUMN public.user_ban.ip_ban_id IS 'Optional, as an IP ban might get removed for another user and we want the offending user to remain banned.';


--
-- Name: user_bans_id_seq; Type: SEQUENCE; Schema: public; Owner: rpfw-dev
--

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


ALTER TABLE public.user_bans_id_seq OWNER TO "rpfw-dev";

--
-- Name: user_bans_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: rpfw-dev
--

ALTER SEQUENCE public.user_bans_id_seq OWNED BY public.user_ban.id;


--
-- Name: user_id_seq; Type: SEQUENCE; Schema: public; Owner: rpfw-dev
--

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


ALTER TABLE public.user_id_seq OWNER TO "rpfw-dev";

--
-- Name: user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: rpfw-dev
--

ALTER SEQUENCE public.user_id_seq OWNED BY public."user".id;


--
-- Name: user_ip; Type: TABLE; Schema: public; Owner: rpfw-dev
--

CREATE TABLE public.user_ip (
    ip_id integer NOT NULL,
    user_id integer NOT NULL,
    updated timestamp without time zone DEFAULT (now())::timestamp without time zone NOT NULL,
    created timestamp without time zone NOT NULL
);


ALTER TABLE public.user_ip OWNER TO "rpfw-dev";

--
-- Name: COLUMN user_ip.updated; Type: COMMENT; Schema: public; Owner: rpfw-dev
--

COMMENT ON COLUMN public.user_ip.updated IS 'For administration purposes it might be usefull to see when a user last used an IP.';


--
-- Name: COLUMN user_ip.created; Type: COMMENT; Schema: public; Owner: rpfw-dev
--

COMMENT ON COLUMN public.user_ip.created IS 'For administration purposes it might be usefull to see when a user started using an IP.';


--
-- Name: user_kick; Type: TABLE; Schema: public; Owner: rpfw-dev
--

CREATE TABLE public.user_kick (
    id integer NOT NULL,
    user_id integer NOT NULL,
    created timestamp without time zone DEFAULT (now())::timestamp without time zone,
    reason character varying(121) NOT NULL,
    kicker_id integer,
    ip_kick_id integer NOT NULL
);


ALTER TABLE public.user_kick OWNER TO "rpfw-dev";

--
-- Name: user_kicks_id_seq; Type: SEQUENCE; Schema: public; Owner: rpfw-dev
--

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


ALTER TABLE public.user_kicks_id_seq OWNER TO "rpfw-dev";

--
-- Name: user_kicks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: rpfw-dev
--

ALTER SEQUENCE public.user_kicks_id_seq OWNED BY public.user_kick.id;


--
-- Name: user_user_id_seq; Type: SEQUENCE; Schema: public; Owner: rpfw-dev
--

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


ALTER TABLE public.user_user_id_seq OWNER TO "rpfw-dev";

--
-- Name: character id; Type: DEFAULT; Schema: public; Owner: rpfw-dev
--

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


--
-- Name: ip id; Type: DEFAULT; Schema: public; Owner: rpfw-dev
--

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


--
-- Name: ip_ban id; Type: DEFAULT; Schema: public; Owner: rpfw-dev
--

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


--
-- Name: ip_kick id; Type: DEFAULT; Schema: public; Owner: rpfw-dev
--

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


--
-- Name: user id; Type: DEFAULT; Schema: public; Owner: rpfw-dev
--

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


--
-- Name: user_ban id; Type: DEFAULT; Schema: public; Owner: rpfw-dev
--

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


--
-- Name: user_kick id; Type: DEFAULT; Schema: public; Owner: rpfw-dev
--

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


--
-- Data for Name: character; Type: TABLE DATA; Schema: public; Owner: rpfw-dev
--

COPY public."character" (id, user_id, name, skin_id, cash, health, armour, jailed, pos_x, pos_y, pos_z, rotation, created) FROM stdin;
25	10	Ni_Ko	78	0	100	0	0	-146	1205	19.636656	269	2020-02-17 17:09:33.001327
24	10	Jo_Bo	134	0	100	0	0	-148.03046	1211.75	19.735197	103.99999	2020-02-17 17:09:01.880547
\.


--
-- Data for Name: ip; Type: TABLE DATA; Schema: public; Owner: rpfw-dev
--

COPY public.ip (id, address, connections) FROM stdin;
49	127.0.0.1	36
\.


--
-- Data for Name: ip_ban; Type: TABLE DATA; Schema: public; Owner: rpfw-dev
--

COPY public.ip_ban (id, ip_id, created, expires, reason, banner_id) FROM stdin;
\.


--
-- Data for Name: ip_kick; Type: TABLE DATA; Schema: public; Owner: rpfw-dev
--

COPY public.ip_kick (id, ip_id, created, reason, kicker_id) FROM stdin;
\.


--
-- Data for Name: user; Type: TABLE DATA; Schema: public; Owner: rpfw-dev
--

COPY public."user" (id, name, level, password, webaccount_id, jailed, created) FROM stdin;
10	Player	1	DF3210C97BB5895B32A09C3CD9A905248FD2F34720711152C92EE6D1828E3122B0844C565536C5214B5F2C137FF638BD86F03EBC412DDDDD4018F968819BEEC0	\N	0	2020-02-17 17:09:01.874546
\.


--
-- Data for Name: user_ban; Type: TABLE DATA; Schema: public; Owner: rpfw-dev
--

COPY public.user_ban (id, user_id, created, expires, reason, banner, ip_ban_id) FROM stdin;
\.


--
-- Data for Name: user_ip; Type: TABLE DATA; Schema: public; Owner: rpfw-dev
--

COPY public.user_ip (ip_id, user_id, updated, created) FROM stdin;
\.


--
-- Data for Name: user_kick; Type: TABLE DATA; Schema: public; Owner: rpfw-dev
--

COPY public.user_kick (id, user_id, created, reason, kicker_id, ip_kick_id) FROM stdin;
\.


--
-- Name: character_character_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
--

SELECT pg_catalog.setval('public.character_character_id_seq', 1, false);


--
-- Name: character_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
--

SELECT pg_catalog.setval('public.character_id_seq', 1, false);


--
-- Name: character_id_seq1; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
--

SELECT pg_catalog.setval('public.character_id_seq1', 25, true);


--
-- Name: ip_bans_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
--

SELECT pg_catalog.setval('public.ip_bans_id_seq', 1, false);


--
-- Name: ip_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
--

SELECT pg_catalog.setval('public.ip_id_seq', 84, true);


--
-- Name: ip_ip_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
--

SELECT pg_catalog.setval('public.ip_ip_id_seq', 133, true);


--
-- Name: ip_kick_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
--

SELECT pg_catalog.setval('public.ip_kick_id_seq', 1, false);


--
-- Name: user_bans_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
--

SELECT pg_catalog.setval('public.user_bans_id_seq', 1, false);


--
-- Name: user_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
--

SELECT pg_catalog.setval('public.user_id_seq', 10, true);


--
-- Name: user_kicks_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
--

SELECT pg_catalog.setval('public.user_kicks_id_seq', 1, false);


--
-- Name: user_user_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
--

SELECT pg_catalog.setval('public.user_user_id_seq', 19, true);


--
-- Name: character character_name_key; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public."character"
    ADD CONSTRAINT character_name_key UNIQUE (name);


--
-- Name: character character_pkey; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public."character"
    ADD CONSTRAINT character_pkey PRIMARY KEY (id);


--
-- Name: ip ip_address_key; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public.ip
    ADD CONSTRAINT ip_address_key UNIQUE (address);


--
-- Name: ip_ban ip_bans_pkey; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public.ip_ban
    ADD CONSTRAINT ip_bans_pkey PRIMARY KEY (id);


--
-- Name: ip_kick ip_kick_pkey; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public.ip_kick
    ADD CONSTRAINT ip_kick_pkey PRIMARY KEY (id);


--
-- Name: ip ip_pkey; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public.ip
    ADD CONSTRAINT ip_pkey PRIMARY KEY (id);


--
-- Name: user_ban user_bans_pkey; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public.user_ban
    ADD CONSTRAINT user_bans_pkey PRIMARY KEY (id);


--
-- Name: user_ip user_ip_pkey; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public.user_ip
    ADD CONSTRAINT user_ip_pkey PRIMARY KEY (ip_id, user_id);


--
-- Name: user_kick user_kicks_pkey; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public.user_kick
    ADD CONSTRAINT user_kicks_pkey PRIMARY KEY (id);


--
-- Name: user user_name_key; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public."user"
    ADD CONSTRAINT user_name_key UNIQUE (name);


--
-- Name: user user_pkey; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public."user"
    ADD CONSTRAINT user_pkey PRIMARY KEY (id);


--
-- Name: character character_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public."character"
    ADD CONSTRAINT character_user_id_fkey FOREIGN KEY (user_id) REFERENCES public."user"(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: user_ban ip_ban_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public.user_ban
    ADD CONSTRAINT ip_ban_id_fkey FOREIGN KEY (ip_ban_id) REFERENCES public.ip_ban(id) ON UPDATE CASCADE NOT VALID;


--
-- Name: CONSTRAINT ip_ban_id_fkey ON user_ban; Type: COMMENT; Schema: public; Owner: rpfw-dev
--

COMMENT ON CONSTRAINT ip_ban_id_fkey ON public.user_ban IS 'IP ban can be removed while character ban remains';


--
-- Name: ip_ban ip_bans_banner_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public.ip_ban
    ADD CONSTRAINT ip_bans_banner_fkey FOREIGN KEY (banner_id) REFERENCES public."user"(id) ON UPDATE CASCADE;


--
-- Name: ip_ban ip_bans_ip_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public.ip_ban
    ADD CONSTRAINT ip_bans_ip_id_fkey FOREIGN KEY (ip_id) REFERENCES public.ip(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: ip_kick ip_kick_ip_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public.ip_kick
    ADD CONSTRAINT ip_kick_ip_id_fkey FOREIGN KEY (ip_id) REFERENCES public.ip(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: ip_kick ip_kick_kicker_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public.ip_kick
    ADD CONSTRAINT ip_kick_kicker_id_fkey FOREIGN KEY (kicker_id) REFERENCES public."user"(id) ON UPDATE CASCADE;


--
-- Name: user_ban user_bans_banner_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public.user_ban
    ADD CONSTRAINT user_bans_banner_fkey FOREIGN KEY (banner) REFERENCES public."user"(id) ON UPDATE CASCADE;


--
-- Name: user_ban user_bans_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public.user_ban
    ADD CONSTRAINT user_bans_user_id_fkey FOREIGN KEY (user_id) REFERENCES public."user"(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: user_ip user_ip_ip_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public.user_ip
    ADD CONSTRAINT user_ip_ip_id_fkey FOREIGN KEY (ip_id) REFERENCES public.ip(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: user_ip user_ip_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public.user_ip
    ADD CONSTRAINT user_ip_user_id_fkey FOREIGN KEY (user_id) REFERENCES public."user"(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: user_kick user_kick_ip_kick_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public.user_kick
    ADD CONSTRAINT user_kick_ip_kick_id_fkey FOREIGN KEY (ip_kick_id) REFERENCES public.ip_kick(id) NOT VALID;


--
-- Name: user_kick user_kick_kicker_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public.user_kick
    ADD CONSTRAINT user_kick_kicker_id_fkey FOREIGN KEY (kicker_id) REFERENCES public."user"(id) ON UPDATE CASCADE;


--
-- Name: user_kick user_kick_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public.user_kick
    ADD CONSTRAINT user_kick_user_id_fkey FOREIGN KEY (user_id) REFERENCES public."user"(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- PostgreSQL database dump complete
--

