This repository has been archived by the owner on Aug 23, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 70
/
schema.sql
1142 lines (769 loc) · 25.3 KB
/
schema.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-- The IdleRPG Discord Bot
-- Copyright (C) 2018-2021 Diniboy and Gelbpunkt
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
--
-- PostgreSQL database dump
--
-- Dumped from database version 14.1
-- Dumped by pg_dump version 14.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;
--
-- Name: rgba; Type: TYPE; Schema: public; Owner: jens
--
CREATE TYPE public.rgba AS (
red integer,
green integer,
blue integer,
alpha real
);
ALTER TYPE public.rgba OWNER TO jens;
--
-- Name: insert_alliance_default(); Type: FUNCTION; Schema: public; Owner: jens
--
CREATE FUNCTION public.insert_alliance_default() RETURNS trigger
LANGUAGE plpgsql
AS $$
begin
if NEW.alliance is null then
NEW.alliance := NEW.id;
end if;
return new;
end;
$$;
ALTER FUNCTION public.insert_alliance_default() OWNER TO jens;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: allitems; Type: TABLE; Schema: public; Owner: jens
--
CREATE TABLE public.allitems (
id bigint NOT NULL,
owner bigint,
name character varying(200) NOT NULL,
value integer NOT NULL,
type character varying(10) NOT NULL,
damage numeric(5,2) NOT NULL,
armor numeric(5,2) NOT NULL,
signature character varying(50) DEFAULT NULL::character varying,
original_type character varying(10) DEFAULT NULL::character varying,
original_name character varying(200) DEFAULT NULL::character varying,
hand character varying(10) NOT NULL
);
ALTER TABLE public.allitems OWNER TO jens;
--
-- Name: allitems_id_seq; Type: SEQUENCE; Schema: public; Owner: jens
--
CREATE SEQUENCE public.allitems_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.allitems_id_seq OWNER TO jens;
--
-- Name: allitems_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: jens
--
ALTER SEQUENCE public.allitems_id_seq OWNED BY public.allitems.id;
--
-- Name: bans; Type: TABLE; Schema: public; Owner: jens
--
CREATE TABLE public.bans (
"user" bigint NOT NULL,
reason character varying(100) DEFAULT NULL::character varying
);
ALTER TABLE public.bans OWNER TO jens;
--
-- Name: chess_matches; Type: TABLE; Schema: public; Owner: jens
--
CREATE TABLE public.chess_matches (
id integer NOT NULL,
player1 bigint,
player2 bigint,
result character varying(7) NOT NULL,
pgn text NOT NULL,
winner bigint
);
ALTER TABLE public.chess_matches OWNER TO jens;
--
-- Name: chess_matches_id_seq; Type: SEQUENCE; Schema: public; Owner: jens
--
CREATE SEQUENCE public.chess_matches_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.chess_matches_id_seq OWNER TO jens;
--
-- Name: chess_matches_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: jens
--
ALTER SEQUENCE public.chess_matches_id_seq OWNED BY public.chess_matches.id;
--
-- Name: chess_players; Type: TABLE; Schema: public; Owner: jens
--
CREATE TABLE public.chess_players (
"user" bigint NOT NULL,
elo bigint DEFAULT 1000 NOT NULL
);
ALTER TABLE public.chess_players OWNER TO jens;
--
-- Name: children; Type: TABLE; Schema: public; Owner: jens
--
CREATE TABLE public.children (
mother bigint,
father bigint,
name character varying(20),
age bigint,
gender character varying(10)
);
ALTER TABLE public.children OWNER TO jens;
--
-- Name: city; Type: TABLE; Schema: public; Owner: jens
--
CREATE TABLE public.city (
name character varying(25) NOT NULL,
owner bigint NOT NULL,
thief_building integer DEFAULT 0,
raid_building integer DEFAULT 0,
trade_building integer DEFAULT 0,
adventure_building integer DEFAULT 0
);
ALTER TABLE public.city OWNER TO jens;
--
-- Name: coupon; Type: TABLE; Schema: public; Owner: jens
--
CREATE TABLE public.coupon (
"from" bigint NOT NULL,
"to" bigint,
created_at timestamp with time zone DEFAULT now(),
code character varying(10) NOT NULL,
id integer NOT NULL
);
ALTER TABLE public.coupon OWNER TO jens;
--
-- Name: coupon_id_seq; Type: SEQUENCE; Schema: public; Owner: jens
--
CREATE SEQUENCE public.coupon_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.coupon_id_seq OWNER TO jens;
--
-- Name: coupon_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: jens
--
ALTER SEQUENCE public.coupon_id_seq OWNED BY public.coupon.id;
--
-- Name: defenses; Type: TABLE; Schema: public; Owner: jens
--
CREATE TABLE public.defenses (
city character varying(25) NOT NULL,
name character varying(25) NOT NULL,
hp integer NOT NULL,
defense integer NOT NULL,
id integer NOT NULL
);
ALTER TABLE public.defenses OWNER TO jens;
--
-- Name: defenses_id_seq; Type: SEQUENCE; Schema: public; Owner: jens
--
CREATE SEQUENCE public.defenses_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.defenses_id_seq OWNER TO jens;
--
-- Name: defenses_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: jens
--
ALTER SEQUENCE public.defenses_id_seq OWNED BY public.defenses.id;
--
-- Name: guild; Type: TABLE; Schema: public; Owner: jens
--
CREATE TABLE public.guild (
id integer NOT NULL,
name character varying(20) NOT NULL,
memberlimit bigint NOT NULL,
leader bigint,
icon character varying(60),
money bigint DEFAULT 0,
wins bigint DEFAULT 0,
banklimit bigint DEFAULT 250000,
badges text[],
badge character varying(100) DEFAULT NULL::character varying,
description character varying(200) DEFAULT 'No Description set yet'::character varying NOT NULL,
channel bigint,
upgrade bigint DEFAULT 1 NOT NULL,
alliance bigint
);
ALTER TABLE public.guild OWNER TO jens;
--
-- Name: guild_id_seq; Type: SEQUENCE; Schema: public; Owner: jens
--
CREATE SEQUENCE public.guild_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.guild_id_seq OWNER TO jens;
--
-- Name: guild_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: jens
--
ALTER SEQUENCE public.guild_id_seq OWNED BY public.guild.id;
--
-- Name: helpme; Type: TABLE; Schema: public; Owner: jens
--
CREATE TABLE public.helpme (
id bigint NOT NULL
);
ALTER TABLE public.helpme OWNER TO jens;
--
-- Name: inventory; Type: TABLE; Schema: public; Owner: jens
--
CREATE TABLE public.inventory (
id bigint NOT NULL,
item bigint,
equipped boolean NOT NULL
);
ALTER TABLE public.inventory OWNER TO jens;
--
-- Name: inventory_id_seq; Type: SEQUENCE; Schema: public; Owner: jens
--
CREATE SEQUENCE public.inventory_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.inventory_id_seq OWNER TO jens;
--
-- Name: inventory_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: jens
--
ALTER SEQUENCE public.inventory_id_seq OWNED BY public.inventory.id;
--
-- Name: loot; Type: TABLE; Schema: public; Owner: jens
--
CREATE TABLE public.loot (
id integer NOT NULL,
name character varying(50) NOT NULL,
value bigint NOT NULL,
"user" bigint NOT NULL
);
ALTER TABLE public.loot OWNER TO jens;
--
-- Name: loot_id_seq; Type: SEQUENCE; Schema: public; Owner: jens
--
CREATE SEQUENCE public.loot_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.loot_id_seq OWNER TO jens;
--
-- Name: loot_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: jens
--
ALTER SEQUENCE public.loot_id_seq OWNED BY public.loot.id;
--
-- Name: market; Type: TABLE; Schema: public; Owner: jens
--
CREATE TABLE public.market (
id bigint NOT NULL,
item bigint,
price integer NOT NULL,
published timestamp with time zone DEFAULT now()
);
ALTER TABLE public.market OWNER TO jens;
--
-- Name: market_history; Type: TABLE; Schema: public; Owner: jens
--
CREATE TABLE public.market_history (
id integer NOT NULL,
item bigint NOT NULL,
name character varying(200) NOT NULL,
value integer NOT NULL,
type character varying(10) NOT NULL,
damage numeric(5,2) NOT NULL,
armor numeric(5,2) NOT NULL,
signature character varying(50) DEFAULT NULL::character varying,
price bigint NOT NULL,
"timestamp" timestamp with time zone DEFAULT now(),
offer bigint NOT NULL
);
ALTER TABLE public.market_history OWNER TO jens;
--
-- Name: market_history_id_seq; Type: SEQUENCE; Schema: public; Owner: jens
--
CREATE SEQUENCE public.market_history_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.market_history_id_seq OWNER TO jens;
--
-- Name: market_history_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: jens
--
ALTER SEQUENCE public.market_history_id_seq OWNED BY public.market_history.id;
--
-- Name: market_id_seq; Type: SEQUENCE; Schema: public; Owner: jens
--
CREATE SEQUENCE public.market_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.market_id_seq OWNER TO jens;
--
-- Name: market_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: jens
--
ALTER SEQUENCE public.market_id_seq OWNED BY public.market.id;
--
-- Name: pets; Type: TABLE; Schema: public; Owner: jens
--
CREATE TABLE public.pets (
"user" bigint NOT NULL,
name character varying(20) DEFAULT 'Kevin'::character varying NOT NULL,
image character varying(60) DEFAULT 'https://i.imgur.com/IHhXjXg.jpg'::character varying NOT NULL,
food bigint DEFAULT 100 NOT NULL,
drink bigint DEFAULT 100 NOT NULL,
love bigint DEFAULT 100 NOT NULL,
joy bigint DEFAULT 100 NOT NULL,
last_update timestamp with time zone DEFAULT timezone('utc'::text, now()) NOT NULL
);
ALTER TABLE public.pets OWNER TO jens;
--
-- Name: profile; Type: TABLE; Schema: public; Owner: jens
--
CREATE TABLE public.profile (
"user" bigint NOT NULL,
name character varying(20),
money bigint,
xp integer,
pvpwins bigint DEFAULT 0 NOT NULL,
money_booster bigint DEFAULT 0,
time_booster bigint DEFAULT 0,
luck_booster bigint DEFAULT 0,
marriage bigint DEFAULT 0,
background character varying(60) DEFAULT 0,
guild bigint DEFAULT 0,
class character varying(50)[] DEFAULT '{"No Class","No Class"}'::character varying[],
deaths bigint DEFAULT 0,
completed bigint DEFAULT 0,
lovescore bigint DEFAULT 0 NOT NULL,
guildrank character varying(20) DEFAULT 'Member'::character varying,
backgrounds text[],
puzzles bigint DEFAULT 0,
atkmultiply numeric DEFAULT 1.0,
defmultiply numeric DEFAULT 1.0,
crates_common bigint DEFAULT 0,
crates_uncommon bigint DEFAULT 0,
crates_rare bigint DEFAULT 0,
crates_magic bigint DEFAULT 0,
crates_legendary bigint DEFAULT 0,
luck numeric DEFAULT 1.0,
god character varying(50) DEFAULT NULL::character varying,
favor bigint DEFAULT 0,
race character varying(30) DEFAULT 'Human'::character varying,
cv bigint DEFAULT '-1'::integer,
reset_points bigint DEFAULT 2 NOT NULL,
chocolates integer DEFAULT 0,
trickortreat bigint DEFAULT 0,
eastereggs bigint DEFAULT 0,
colour public.rgba DEFAULT '(0,0,0,1)'::public.rgba,
badges bit varying(16) DEFAULT '0'::"bit",
crates_mystery bigint DEFAULT 0
);
ALTER TABLE public.profile OWNER TO jens;
--
-- Name: reminders; Type: TABLE; Schema: public; Owner: jens
--
CREATE TABLE public.reminders (
"user" bigint NOT NULL,
content character varying(100) NOT NULL,
internal_id uuid,
id integer NOT NULL,
"end" timestamp without time zone NOT NULL,
channel bigint NOT NULL,
start timestamp without time zone NOT NULL,
type character varying(20) DEFAULT 'reminder'::character varying NOT NULL
);
ALTER TABLE public.reminders OWNER TO jens;
--
-- Name: reminders_id_seq; Type: SEQUENCE; Schema: public; Owner: jens
--
CREATE SEQUENCE public.reminders_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.reminders_id_seq OWNER TO jens;
--
-- Name: reminders_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: jens
--
ALTER SEQUENCE public.reminders_id_seq OWNED BY public.reminders.id;
--
-- Name: server; Type: TABLE; Schema: public; Owner: jens
--
CREATE TABLE public.server (
id bigint NOT NULL,
prefix character varying(10)
);
ALTER TABLE public.server OWNER TO jens;
--
-- Name: transactions; Type: TABLE; Schema: public; Owner: jens
--
CREATE TABLE public.transactions (
id integer NOT NULL,
"from" bigint NOT NULL,
"to" bigint NOT NULL,
subject character varying(50) NOT NULL,
info character varying(582) NOT NULL,
"timestamp" timestamp with time zone NOT NULL
);
ALTER TABLE public.transactions OWNER TO jens;
--
-- Name: transactions_id_seq; Type: SEQUENCE; Schema: public; Owner: jens
--
CREATE SEQUENCE public.transactions_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.transactions_id_seq OWNER TO jens;
--
-- Name: transactions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: jens
--
ALTER SEQUENCE public.transactions_id_seq OWNED BY public.transactions.id;
--
-- Name: user_settings; Type: TABLE; Schema: public; Owner: jens
--
CREATE TABLE public.user_settings (
"user" bigint NOT NULL,
locale character varying(20) DEFAULT 'en_US'::character varying NOT NULL,
adventure_reminder boolean DEFAULT false NOT NULL
);
ALTER TABLE public.user_settings OWNER TO jens;
--
-- Name: allitems id; Type: DEFAULT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.allitems ALTER COLUMN id SET DEFAULT nextval('public.allitems_id_seq'::regclass);
--
-- Name: chess_matches id; Type: DEFAULT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.chess_matches ALTER COLUMN id SET DEFAULT nextval('public.chess_matches_id_seq'::regclass);
--
-- Name: coupon id; Type: DEFAULT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.coupon ALTER COLUMN id SET DEFAULT nextval('public.coupon_id_seq'::regclass);
--
-- Name: defenses id; Type: DEFAULT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.defenses ALTER COLUMN id SET DEFAULT nextval('public.defenses_id_seq'::regclass);
--
-- Name: guild id; Type: DEFAULT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.guild ALTER COLUMN id SET DEFAULT nextval('public.guild_id_seq'::regclass);
--
-- Name: inventory id; Type: DEFAULT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.inventory ALTER COLUMN id SET DEFAULT nextval('public.inventory_id_seq'::regclass);
--
-- Name: loot id; Type: DEFAULT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.loot ALTER COLUMN id SET DEFAULT nextval('public.loot_id_seq'::regclass);
--
-- Name: market id; Type: DEFAULT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.market ALTER COLUMN id SET DEFAULT nextval('public.market_id_seq'::regclass);
--
-- Name: market_history id; Type: DEFAULT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.market_history ALTER COLUMN id SET DEFAULT nextval('public.market_history_id_seq'::regclass);
--
-- Name: reminders id; Type: DEFAULT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.reminders ALTER COLUMN id SET DEFAULT nextval('public.reminders_id_seq'::regclass);
--
-- Name: transactions id; Type: DEFAULT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.transactions ALTER COLUMN id SET DEFAULT nextval('public.transactions_id_seq'::regclass);
--
-- Name: allitems allitems_pkey; Type: CONSTRAINT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.allitems
ADD CONSTRAINT allitems_pkey PRIMARY KEY (id);
--
-- Name: bans bans_pkey; Type: CONSTRAINT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.bans
ADD CONSTRAINT bans_pkey PRIMARY KEY ("user");
--
-- Name: chess_matches chess_matches_pkey; Type: CONSTRAINT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.chess_matches
ADD CONSTRAINT chess_matches_pkey PRIMARY KEY (id);
--
-- Name: chess_players chess_players_pkey; Type: CONSTRAINT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.chess_players
ADD CONSTRAINT chess_players_pkey PRIMARY KEY ("user");
--
-- Name: city city_pkey; Type: CONSTRAINT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.city
ADD CONSTRAINT city_pkey PRIMARY KEY (name);
--
-- Name: coupon coupon_pkey; Type: CONSTRAINT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.coupon
ADD CONSTRAINT coupon_pkey PRIMARY KEY (code);
--
-- Name: defenses defenses_pkey; Type: CONSTRAINT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.defenses
ADD CONSTRAINT defenses_pkey PRIMARY KEY (id);
--
-- Name: guild guild_pkey; Type: CONSTRAINT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.guild
ADD CONSTRAINT guild_pkey PRIMARY KEY (id);
--
-- Name: helpme helpme_pkey; Type: CONSTRAINT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.helpme
ADD CONSTRAINT helpme_pkey PRIMARY KEY (id);
--
-- Name: inventory inventory_pkey; Type: CONSTRAINT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.inventory
ADD CONSTRAINT inventory_pkey PRIMARY KEY (id);
--
-- Name: loot loot_pkey; Type: CONSTRAINT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.loot
ADD CONSTRAINT loot_pkey PRIMARY KEY (id);
--
-- Name: market_history market_history_pkey; Type: CONSTRAINT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.market_history
ADD CONSTRAINT market_history_pkey PRIMARY KEY (id);
--
-- Name: market market_pkey; Type: CONSTRAINT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.market
ADD CONSTRAINT market_pkey PRIMARY KEY (id);
--
-- Name: pets pets_pkey; Type: CONSTRAINT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.pets
ADD CONSTRAINT pets_pkey PRIMARY KEY ("user");
--
-- Name: profile profile_pkey; Type: CONSTRAINT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.profile
ADD CONSTRAINT profile_pkey PRIMARY KEY ("user");
--
-- Name: reminders reminders_pkey; Type: CONSTRAINT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.reminders
ADD CONSTRAINT reminders_pkey PRIMARY KEY (id);
--
-- Name: server server_pkey; Type: CONSTRAINT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.server
ADD CONSTRAINT server_pkey PRIMARY KEY (id);
--
-- Name: transactions transactions_pkey; Type: CONSTRAINT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.transactions
ADD CONSTRAINT transactions_pkey PRIMARY KEY (id);
--
-- Name: user_settings user_settings_pkey; Type: CONSTRAINT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.user_settings
ADD CONSTRAINT user_settings_pkey PRIMARY KEY ("user");
--
-- Name: allitems_id_idx; Type: INDEX; Schema: public; Owner: jens
--
CREATE INDEX allitems_id_idx ON public.allitems USING btree (id);
--
-- Name: allitems_owner_idx; Type: INDEX; Schema: public; Owner: jens
--
CREATE INDEX allitems_owner_idx ON public.allitems USING btree (owner);
--
-- Name: inventory_item_idx; Type: INDEX; Schema: public; Owner: jens
--
CREATE INDEX inventory_item_idx ON public.inventory USING btree (item);
--
-- Name: loot_id_idx; Type: INDEX; Schema: public; Owner: jens
--
CREATE INDEX loot_id_idx ON public.loot USING btree (id);
--
-- Name: market_item_idx; Type: INDEX; Schema: public; Owner: jens
--
CREATE INDEX market_item_idx ON public.market USING btree (item);
--
-- Name: profile_guild_idx; Type: INDEX; Schema: public; Owner: jens
--
CREATE INDEX profile_guild_idx ON public.profile USING btree (guild);
--
-- Name: profile_lovescore_idx; Type: INDEX; Schema: public; Owner: jens
--
CREATE INDEX profile_lovescore_idx ON public.profile USING btree (lovescore);
--
-- Name: profile_money_idx; Type: INDEX; Schema: public; Owner: jens
--
CREATE INDEX profile_money_idx ON public.profile USING btree (money);
--
-- Name: profile_pvpwins_idx; Type: INDEX; Schema: public; Owner: jens
--
CREATE INDEX profile_pvpwins_idx ON public.profile USING btree (pvpwins);
--
-- Name: profile_xp_idx; Type: INDEX; Schema: public; Owner: jens
--
CREATE INDEX profile_xp_idx ON public.profile USING btree (xp);
--
-- Name: guild insert_alliance_default; Type: TRIGGER; Schema: public; Owner: jens
--
CREATE TRIGGER insert_alliance_default BEFORE INSERT ON public.guild FOR EACH ROW EXECUTE FUNCTION public.insert_alliance_default();
--
-- Name: allitems allitems_owner_fkey; Type: FK CONSTRAINT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.allitems
ADD CONSTRAINT allitems_owner_fkey FOREIGN KEY (owner) REFERENCES public.profile("user");
--
-- Name: chess_matches chess_matches_player1_fkey; Type: FK CONSTRAINT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.chess_matches
ADD CONSTRAINT chess_matches_player1_fkey FOREIGN KEY (player1) REFERENCES public.chess_players("user");
--
-- Name: chess_matches chess_matches_player2_fkey; Type: FK CONSTRAINT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.chess_matches
ADD CONSTRAINT chess_matches_player2_fkey FOREIGN KEY (player2) REFERENCES public.chess_players("user");
--
-- Name: chess_matches chess_matches_winner_fkey; Type: FK CONSTRAINT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.chess_matches
ADD CONSTRAINT chess_matches_winner_fkey FOREIGN KEY (winner) REFERENCES public.chess_players("user");
--
-- Name: city city_owner_fkey; Type: FK CONSTRAINT; Schema: public; Owner: jens
--
ALTER TABLE ONLY public.city
ADD CONSTRAINT city_owner_fkey FOREIGN KEY (owner) REFERENCES public.guild(id);
--
-- Name: defenses defenses_city_fkey; Type: FK CONSTRAINT; Schema: public; Owner: jens
--