--
-- 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,
    job_id smallint DEFAULT 0 NOT NULL,
    world_id smallint DEFAULT 0 NOT NULL,
    interior_id smallint DEFAULT 0 NOT NULL,
    job_skin_id smallint,
    weapon_slot_0 smallint,
    weapon_slot_1 smallint,
    weapon_slot_2 smallint,
    weapon_slot_3 smallint,
    weapon_slot_4 smallint,
    weapon_slot_5 smallint,
    weapon_slot_6 smallint,
    weapon_slot_7 smallint,
    weapon_slot_8 smallint,
    weapon_slot_9 smallint,
    weapon_slot_10 smallint,
    weapon_slot_11 smallint,
    weapon_slot_12 smallint,
    weapon_skill_0 smallint DEFAULT 0 NOT NULL,
    weapon_skill_1 smallint DEFAULT 0 NOT NULL,
    weapon_skill_2 smallint DEFAULT 0 NOT NULL,
    weapon_skill_3 smallint DEFAULT 0 NOT NULL,
    weapon_skill_4 smallint DEFAULT 0 NOT NULL,
    weapon_skill_5 smallint DEFAULT 0 NOT NULL,
    weapon_skill_6 smallint DEFAULT 0 NOT NULL,
    weapon_skill_7 smallint DEFAULT 0 NOT NULL,
    weapon_skill_8 smallint DEFAULT 0 NOT NULL,
    weapon_skill_9 smallint DEFAULT 0 NOT NULL,
    weapon_skill_10 smallint DEFAULT 0 NOT NULL
);
ALTER TABLE ONLY public."character" ALTER COLUMN job_id SET (n_distinct=0);


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
);


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: pickup; Type: TABLE; Schema: public; Owner: rpfw-dev
--

CREATE TABLE public.pickup (
    id integer NOT NULL,
    object_id smallint NOT NULL,
    pos_x real NOT NULL,
    pos_y real NOT NULL,
    pos_z real NOT NULL,
    world_id smallint NOT NULL,
    interior_id smallint NOT NULL,
    type_id smallint NOT NULL,
    pickup_id smallint,
    angle real DEFAULT 0 NOT NULL
);


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

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

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


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

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

ALTER SEQUENCE public.pickup_id_seq OWNED BY public.pickup.id;


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

CREATE TABLE public.portal (
    id integer NOT NULL,
    object smallint NOT NULL,
    pos_x real NOT NULL,
    pos_y real NOT NULL,
    pos_z real NOT NULL,
    world smallint NOT NULL,
    exit_object smallint,
    exit_pos_x real,
    exit_pos_y real,
    exit_pos_z real,
    exit_world smallint,
    pickup_id smallint,
    exit_pickup_id smallint,
    interior_id smallint DEFAULT 0 NOT NULL,
    exit_interior_id smallint,
    angle real DEFAULT 0 NOT NULL,
    exit_angle real
);


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

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

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


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

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

ALTER SEQUENCE public.portal_id_seq OWNED BY public.portal.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
);


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: vehicle; Type: TABLE; Schema: public; Owner: rpfw-dev
--

CREATE TABLE public.vehicle (
    id integer NOT NULL,
    model_id smallint NOT NULL,
    pos_x real NOT NULL,
    pos_y real NOT NULL,
    pos_z real NOT NULL,
    angle real NOT NULL,
    color1 smallint DEFAULT '-1'::integer NOT NULL,
    color2 smallint DEFAULT '-1'::integer NOT NULL,
    respawn_delay smallint DEFAULT '-1'::integer NOT NULL,
    addsiren smallint DEFAULT '-1'::integer NOT NULL,
    vehicle_id smallint
);


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

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

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


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

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

ALTER SEQUENCE public.vehicle_id_seq OWNED BY public.vehicle.id;


--
-- 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: pickup id; Type: DEFAULT; Schema: public; Owner: rpfw-dev
--

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


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

ALTER TABLE ONLY public.portal ALTER COLUMN id SET DEFAULT nextval('public.portal_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);


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

ALTER TABLE ONLY public.vehicle ALTER COLUMN id SET DEFAULT nextval('public.vehicle_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, job_id, world_id, interior_id, job_skin_id, weapon_slot_0, weapon_slot_1, weapon_slot_2, weapon_slot_3, weapon_slot_4, weapon_slot_5, weapon_slot_6, weapon_slot_7, weapon_slot_8, weapon_slot_9, weapon_slot_10, weapon_slot_11, weapon_slot_12, weapon_skill_0, weapon_skill_1, weapon_skill_2, weapon_skill_3, weapon_skill_4, weapon_skill_5, weapon_skill_6, weapon_skill_7, weapon_skill_8, weapon_skill_9, weapon_skill_10) FROM stdin;
37	13	Jo_Bo	134	47	100	0	0	-199.62967	992.9551	19.032475	33.898186	2020-02-26 17:46:13.40483	0	0	0	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	0	0	0	0	0	0	0	0	0	0	0
\.


--
-- 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	235
\.


--
-- 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: pickup; Type: TABLE DATA; Schema: public; Owner: rpfw-dev
--

COPY public.pickup (id, object_id, pos_x, pos_y, pos_z, world_id, interior_id, type_id, pickup_id, angle) FROM stdin;
31	1247	-203.16534	1012.1661	19.73446	0	0	1	3	0
30	1247	-202	1005	19.723639	0	0	0	4	0
\.


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

COPY public.portal (id, object, pos_x, pos_y, pos_z, world, exit_object, exit_pos_x, exit_pos_y, exit_pos_z, exit_world, pickup_id, exit_pickup_id, interior_id, exit_interior_id, angle, exit_angle) FROM stdin;
43	19902	-197.22972	1006.7419	19.580938	-1	19607	-193.11603	1001.5561	19.775234	-1	1	2	0	0	359	1.1358372e+09
\.


--
-- 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;
13	Player	1	DF3210C97BB5895B32A09C3CD9A905248FD2F34720711152C92EE6D1828E3122B0844C565536C5214B5F2C137FF638BD86F03EBC412DDDDD4018F968819BEEC0	\N	0	2020-02-26 17:46:13.395829
\.


--
-- 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;
\.


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

COPY public.vehicle (id, model_id, pos_x, pos_y, pos_z, angle, color1, color2, respawn_delay, addsiren, vehicle_id) FROM stdin;
4	411	-205.92249	950.4727	15.779951	92.88477	-1	-1	-1	-1	1
5	411	-190.78378	977.7164	18.630545	62.595642	-1	-1	-1	-1	2
\.


--
-- 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', 39, true);


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

SELECT pg_catalog.setval('public.ip_bans_id_seq', 8, true);


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

SELECT pg_catalog.setval('public.ip_id_seq', 283, 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', 19, true);


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

SELECT pg_catalog.setval('public.pickup_id_seq', 31, true);


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

SELECT pg_catalog.setval('public.portal_id_seq', 43, true);


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

SELECT pg_catalog.setval('public.user_bans_id_seq', 5, true);


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

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


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

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


--
-- 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: vehicle_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
--

SELECT pg_catalog.setval('public.vehicle_id_seq', 5, 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: pickup pickup_pkey; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public.pickup
    ADD CONSTRAINT pickup_pkey PRIMARY KEY (id);


--
-- Name: portal portal_pkey; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public.portal
    ADD CONSTRAINT portal_pkey PRIMARY KEY (id);


--
-- Name: portal unique_location; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public.portal
    ADD CONSTRAINT unique_location UNIQUE (pos_x, pos_y, pos_z, world);


--
-- 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: vehicle vehicle_pkey; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
--

ALTER TABLE ONLY public.vehicle
    ADD CONSTRAINT vehicle_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
--

