-
Notifications
You must be signed in to change notification settings - Fork 0
/
dowschema.html
3832 lines (3581 loc) · 112 KB
/
dowschema.html
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Database Schema for DOW</title>
</head>
<body>
<h1>Database Schema for DOW</h1>
<p>The following is an annoated schema for DOW generated automatically
from the database itself. I've edited it lightly to remove a few
extraneous things such as tables that are no longer used, experimental
tables, the forums, trade board, April Fools jokes, etc.
<p>Overall comments:
The distinction between where to put donor data and where to put other
data was not well thought out. There are many places where I should
have stored ship name rather than donorid, so that if the data is
available for non-donors, there's somewhere to put it.
When table entries get unique ids and when they do not is also
haphazard.
Although turn information is cached back to turn 1004, I did not
generally reparse historic data when I added new tables.
<hr>
<table border><tr><th align=left>Name</th><th align=left>Type</th><th align=left>Comment</th></tr>
<tr valign=top>
<td><a href="#t1">activeships</a> </td>
<td>TABLE </td>
<td>Stores the ships that appear to still be active in the game by extracting them from the TBG mailer at: http://www.pbm.com/tbg/alias.html</td>
</tr>
<tr valign=top>
<td><a href="#t2">adventures</a> </td>
<td>TABLE </td>
<td>Every time an adventure is seen, either from the location report if you're in system or from the "Known Adventures", it is entered into this table. The donation flags indicate who is allowed to view the adventure. As the player pages are processed, the permisions will become more lenient (e.g. when a player who donates all adventures reports the adventure, all the flags get set to true).</td>
</tr>
<tr valign=top>
<td><a href="#t3">aliens</a> </td>
<td>TABLE </td>
<td>Stores static info about alien races. Ships are created with skilllevel modules plus or minus 1 min 1 max 6.</td>
</tr>
<tr valign=top>
<td><a href="#t4">allships</a> </td>
<td>TABLE </td>
<td>For every ship that's ever been seen in DOW on or before the given turn, list the ships status (one of Alien, Player, Retired). It is much faster to store this info once than to generate it each time.</td>
</tr>
<tr valign=top>
<td><a href="#t5">artifacts</a> </td>
<td>TABLE </td>
<td>Artifacts carried by donors. I should have used ship name instead of donorid. Curses are stored in TABLE curses, with a reference to the artifactid. Keys are stored in TABLE keys, with a reference to the artifactid.</td>
</tr>
<tr valign=top>
<td><a href="#t6">badland</a> </td>
<td>TABLE </td>
<td>Stores the danger level for each badland. Not currently used by anything.</td>
</tr>
<tr valign=top>
<td><a href="#t7">banned</a> </td>
<td>TABLE </td>
<td>Which ships are banned from dow, when they were banned, etc.</td>
</tr>
<tr valign=top>
<td><a href="#t8">colonies</a> </td>
<td>TABLE </td>
<td>Stores info about each colony.</td>
</tr>
<tr valign=top>
<td><a href="#t9">corona</a> </td>
<td>TABLE </td>
<td>Stores the danger level of each Stellar Corona. Not currently used by anything.</td>
</tr>
<tr valign=top>
<td><a href="#t10">criminals</a> </td>
<td>TABLE </td>
<td>Records where criminals have been seen. Note that just because you know a criminal is in a location, you cannot necessarily pick him up. I believe you personally need to have been the one to gain the information about his location.</td>
</tr>
<tr valign=top>
<td><a href="#t11">curses</a> </td>
<td>TABLE </td>
<td>Stores the curses on all artifacts. The artifactid is a reference to an entry in TABLE artifacts.</td>
</tr>
<tr valign=top>
<td><a href="#t12">customsetprefs</a> </td>
<td>TABLE </td>
<td>Settings for the Custom Set. Values should have been floats instead of ints.</td>
</tr>
<tr valign=top>
<td><a href="#t14">donors</a> </td>
<td>TABLE </td>
<td>Information about members of DOW are stored here. Each member has a unique donorid.
The dow_pw is stored plain text. It is also stored encripted in the .htaccess file. See the script dowpw.pl for how the passwords are maintained.
If adv_all is set, so should adv_*
If admin is set, then most scripts will allow you to add the argument -u+ShipName and look at the script as that ship. Very useful for debugging.</td>
</tr>
<tr valign=top>
<td><a href="#t15">dowaccess</a> </td>
<td>TABLE </td>
<td>Stores every access to a DOW page that contains a remote_user. This table is huge. Good for detecting spies.</td>
</tr>
<tr valign=top>
<td><a href="#t17">enemies</a> </td>
<td>TABLE </td>
<td>Records the alien races that a donor is enemies with.</td>
</tr>
<tr valign=top>
<td><a href="#t18">factories</a> </td>
<td>TABLE </td>
<td>Static info on which systems product what resources.</td>
</tr>
<tr valign=top>
<td><a href="#t19">favour</a> </td>
<td>TABLE </td>
<td>Amount of favour of DOW members</td>
</tr>
<tr valign=top>
<td><a href="#t20">flags</a> </td>
<td>TABLE </td>
<td>The flag for every non-alien ship</td>
</tr>
<tr valign=top>
<td><a href="#t24">fragments</a> </td>
<td>TABLE </td>
<td>Stores Starnet password fragments. The source is DOW if obtained from a donor's turn pages. Other sources are entered by hand, and are typically GIN or TC (for terminal codes). The source is not used by anything currently.</td>
</tr>
<tr valign=top>
<td><a href="#t25">frozen</a> </td>
<td>TABLE </td>
<td>Lists DOW members who are currently not allowed to access the DOW pages. This includes people who quit the game or quit DOW.</td>
</tr>
<tr valign=top>
<td><a href="#t26">influence</a> </td>
<td>TABLE </td>
<td>Stores influence information for presidential elections.</td>
</tr>
<tr valign=top>
<td><a href="#t27">keys</a> </td>
<td>TABLE </td>
<td>Stores the keys on all artifacts. The artifactid is a reference to an entry in TABLE artifacts.</td>
</tr>
<tr valign=top>
<td><a href="#t28">medicine</a> </td>
<td>TABLE </td>
<td>What medicine is a given ship carrying? Where can it be sold? What's it value?</td>
</tr>
<tr valign=top>
<td><a href="#t29">meetings</a> </td>
<td>TABLE </td>
<td>Stores ship pairing data. "ship1 (protecting protected1) meets ship2 (protecting protected2)".
Any ship field except ship1 may be null (e.g. if a ship is alone in a system).</td>
</tr>
<tr valign=top>
<td><a href="#t30">modules</a> </td>
<td>TABLE </td>
<td>Modules carried by donors. I should have used ship name instead of donorid. See TABLE shop for meaning of type and tech. See also TABLE nmods, a replacement for this table used by newer scripts.</td>
</tr>
<tr valign=top>
<td><a href="#t31">newsettings</a> </td>
<td>TABLE </td>
<td>Used to store user requested changes to their settings. Rows from this table are copied to TABLE donors when the turn turns.</td>
</tr>
<tr valign=top>
<td><a href="#t32">nmods</a> </td>
<td>TABLE </td>
<td>New table for modules. Currently only includes modules on ships, though it was designed for ships and shops. Updated by do_ships.pl, while TABLE modules is updated by updatedow.pl.</td>
</tr>
<tr valign=top>
<td><a href="#t36">plagues</a> </td>
<td>TABLE </td>
<td>Records which plagues a donor has cured.</td>
</tr>
<tr valign=top>
<td><a href="#t37">pods</a> </td>
<td>TABLE </td>
<td>Stores which pods a donor carries. For non-donors, the donorid is null and the ship is set. I really should not have used donorids...</td>
</tr>
<tr valign=top>
<td><a href="#t38">pollitems</a> </td>
<td>TABLE </td>
<td>Stores the possible things to vote on in a poll. The pollid is a reference to an entry in TABLE polls. See also TABLE pollvotes for who voted for what.</td>
</tr>
<tr valign=top>
<td><a href="#t39">polls</a> </td>
<td>TABLE </td>
<td>Stores poll information. See also TABLE pollitems for what you can vote on in a poll and TABLE pollvotes for who voted for what.</td>
</tr>
<tr valign=top>
<td><a href="#t40">pollvotes</a> </td>
<td>TABLE </td>
<td>Stores what donors voted for in a poll.</td>
</tr>
<tr valign=top>
<td><a href="#t41">popcorn</a> </td>
<td>TABLE </td>
<td>Records popcorn sightings.</td>
</tr>
<tr valign=top>
<td><a href="#t42">powerrank</a> </td>
<td>TABLE </td>
<td>Records power rank for all ships. Generated by do_ships.pl</td>
</tr>
<tr valign=top>
<td><a href="#t43">prefs</a> </td>
<td>TABLE </td>
<td>General DOW preferences. This grew organically, and should be cleaned up.</td>
</tr>
<tr valign=top>
<td><a href="#t47">probes</a> </td>
<td>TABLE </td>
<td>Stores where donors have probes deployed. I should have included the turn! Instead, I delete the table every turn and reset with latest values.</td>
</tr>
<tr valign=top>
<td><a href="#t48">purgedsystems</a> </td>
<td>TABLE </td>
<td>Records which system had its Starnet purged</td>
</tr>
<tr valign=top>
<td><a href="#t49">purgesuspects</a> </td>
<td>TABLE </td>
<td>Records who was at a system when its Starnet was purged.</td>
</tr>
<tr valign=top>
<td><a href="#t50">rfat</a> </td>
<td>TABLE </td>
<td>Used to coordinate the science spell 'Report from All Terminals'. See rfat.pl for how it's used.</td>
</tr>
<tr valign=top>
<td><a href="#t51">rings</a> </td>
<td>TABLE </td>
<td>Reports on good and evil ring sightings</td>
</tr>
<tr valign=top>
<td><a href="#t52">rogues</a> </td>
<td>TABLE </td>
<td>Stores location of rogue bands and associated information. Note that the location is represented by what is needed to protect you from the danger of the location.</td>
</tr>
<tr valign=top>
<td><a href="#t53">rss</a> </td>
<td>TABLE </td>
<td>Route simulator settings. Similar to TABLE customsetprefs. See also comments there.</td>
</tr>
<tr valign=top>
<td><a href="#t54">shipcomments</a> </td>
<td>TABLE </td>
<td>Stores comments from DOW members about other ships.</td>
</tr>
<tr valign=top>
<td><a href="#t55">shipconfig</a> </td>
<td>TABLE </td>
<td>Stores the path to where the ship configuration HTML page is stored. Poor choice of name for the table.</td>
</tr>
<tr valign=top>
<td><a href="#t56">shipdata</a> </td>
<td>TABLE </td>
<td>Grab bag of data about donor's ships. Entries have been added as needed rather than designed.</td>
</tr>
<tr valign=top>
<td><a href="#t57">shiploc</a> </td>
<td>TABLE </td>
<td>Stores the locations of ships, including from the turn pages, terminal reports, and trace reports (which is why TABLE meetings is not sufficient, since it only gives the location of the ship, not who it is paired with).</td>
</tr>
<tr valign=top>
<td><a href="#t58">shop</a> </td>
<td>TABLE </td>
<td>Stores shop data. I should have used a unique ID for each shop. Note that I intended to combine this table into TABLE nmods, but I haven't yet.
Types:
Warp 1, impulse 2, sensor 3, cloak 4, life support 5, sickbay 6,
shield 7, ram 8, gun 9, disruptor 10, laser 11, missile 12, drone 13,
fighter 14, pod 15.
Techs:
Primitive 1, Basic 2, Mediocre 3, Advanced 4, Exotic 5, Magic 6.</td>
</tr>
<tr valign=top>
<td><a href="#t59">skills</a> </td>
<td>TABLE </td>
<td>Stores the skill levels of each DOW member. IMPORTANT: Only when a new skill is learned does an entry appear. Each area/name combination should therefore only occur once. BUG: Does not take into account evil ring use!</td>
</tr>
<tr valign=top>
<td><a href="#t60">starcoords</a> </td>
<td>TABLE </td>
<td>Positions of the stars. Note that it is rotated by 90 degrees with respect to how they're displayed. I wish I could remember where I found these values...</td>
</tr>
<tr valign=top>
<td><a href="#t61">stargates</a> </td>
<td>TABLE </td>
<td>Stores stargate information. Note that both directions are stored in the table (e.g. Alnitak/Zosca/1 and Zosca/Alnitak/1).</td>
</tr>
<tr valign=top>
<td><a href="#t62">statics</a> </td>
<td>TABLE </td>
<td>Various static data. Currently one of: Engineering Academy, Engineering School, Hiring Hall, Medical Academy, Medical School, Ocean, Prison, Science Academy, Science School, Weaponry Academy, Weaponry School.</td>
</tr>
<tr valign=top>
<td><a href="#t63">sysplagues</a> </td>
<td>TABLE </td>
<td>Reported level of plagues from donors turn pages.</td>
</tr>
<tr valign=top>
<td><a href="#t64">sysstarnet</a> </td>
<td>TABLE </td>
<td>Static list of systems with Starnet terminals.</td>
</tr>
<tr valign=top>
<td><a href="#t65">systemviewed</a> </td>
<td>TABLE </td>
<td>Stores whether the ship pairings in a given system have been reported on a given turn. An entry exists if there's a turn report, probe report, trace report, or terminal report for the system.</td>
</tr>
<tr valign=top>
<td><a href="#t68">terminals</a> </td>
<td>TABLE </td>
<td>Records which terminals a donor has accessed.</td>
</tr>
<tr valign=top>
<td><a href="#t69">terrain</a> </td>
<td>TABLE </td>
<td>Stores the terrain type of each system. One of Asteroids, Clear, Dyson Sphere, Nebula</td>
</tr>
<tr valign=top>
<td><a href="#t70">traces</a> </td>
<td>TABLE </td>
<td>Stores which ship (if any) a DOW member is tracing.</td>
</tr>
<tr valign=top>
<td><a href="#t71">tracking</a> </td>
<td>TABLE </td>
<td>Stores which ships a DOW member is tracking.</td>
</tr>
<tr valign=top>
<td><a href="#t72">trade</a> </td>
<td>TABLE </td>
<td>Records trade data from player pages, terminal reports, probe reports, and the Presidential database.
IMPORTANT: Since some systems have colonies that buy two of the same
goods, it is possible to have identical entries (except for the
tradeid). I should have assigned each colony a unique ID, and used
that instead of system/resource.
NOTE: The donorid represents who donated the data. It is no longer
used for anything. It is the donorid if it came from the turn report,
-1 for the presidential database, or donorid+1000 for terminal
reports, etc.
NOTE: I added locid about half-way through DOW's life.</td>
</tr>
<tr valign=top>
<td><a href="#t74">turnupdate</a> </td>
<td>TABLE </td>
<td>Records which turn each donor has contributed. A common idiom to get the current turn is: select max(turn) from turnupdate;</td>
</tr>
<tr valign=top>
<td><a href="#t75">xeno_history</a> </td>
<td>TABLE </td>
<td>For each Xeno service, store who/what/when. Note that for the scripts to work, there should always be at least one entry for each Xenologist (e.g. "Joined Xenos").</td>
</tr>
</table>
<hr>
<h3><a name="t1">TABLE activeships</a></h3>
<p>Stores the ships that appear to still be active in the game by extracting them from the TBG mailer at: http://www.pbm.com/tbg/alias.html<p>
<table border="1">
<caption>Table "public.activeships"</caption>
<tr>
<th align="center">Column</th>
<th align="center">Type</th>
<th align="center">Modifiers</th>
<th align="center">Description</th>
</tr>
<tr valign="top">
<td align="left">turn</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">ship</td>
<td align="left">varchar(64)</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">id</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left">ID from the TBG mailer page</td>
</tr>
</table>
<hr>
<h3><a name="t2">TABLE adventures</a></h3>
<p>Every time an adventure is seen, either from the location report if you're in system or from the "Known Adventures", it is entered into this table. The donation flags indicate who is allowed to view the adventure. As the player pages are processed, the permisions will become more lenient (e.g. when a player who donates all adventures reports the adventure, all the flags get set to true).<p>
<table border="1">
<caption>Table "public.adventures"</caption>
<tr>
<th align="center">Column</th>
<th align="center">Type</th>
<th align="center">Modifiers</th>
<th align="center">Description</th>
</tr>
<tr valign="top">
<td align="left">advid</td>
<td align="left">integer</td>
<td align="left">not null default nextval('public.adventures_advid_seq'::text)</td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">area</td>
<td align="left">varchar(16)</td>
<td align="left"> </td>
<td align="left">Engineering, Science, Medical, Weaponry</td>
</tr>
<tr valign="top">
<td align="left">level</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">name</td>
<td align="left">varchar(48)</td>
<td align="left"> </td>
<td align="left">E.g. Moon Adventure 2</td>
</tr>
<tr valign="top">
<td align="left">system</td>
<td align="left">varchar(16)</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">turn</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">sensors</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left">May be blank if unknown</td>
</tr>
<tr valign="top">
<td align="left">adv_newbie</td>
<td align="left">boolean</td>
<td align="left">default false</td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">adv_done</td>
<td align="left">boolean</td>
<td align="left">default false</td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">adv_high</td>
<td align="left">boolean</td>
<td align="left">default false</td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">adv_hard</td>
<td align="left">boolean</td>
<td align="left">default false</td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">adv_all</td>
<td align="left">boolean</td>
<td align="left">default false</td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">locid</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">pub_adv_newbie</td>
<td align="left">boolean</td>
<td align="left">default false</td>
<td align="left"> </td>
</tr>
</table>
<hr>
<h3><a name="t3">TABLE aliens</a></h3>
<p>Stores static info about alien races. Ships are created with skilllevel modules plus or minus 1 min 1 max 6.<p>
<table border="1">
<caption>Table "public.aliens"</caption>
<tr>
<th align="center">Column</th>
<th align="center">Type</th>
<th align="center">Modifiers</th>
<th align="center">Description</th>
</tr>
<tr valign="top">
<td align="left">race</td>
<td align="left">varchar(16)</td>
<td align="left"> </td>
<td align="left">E.g. Ant, Spider</td>
</tr>
<tr valign="top">
<td align="left">alignment</td>
<td align="left">varchar(16)</td>
<td align="left"> </td>
<td align="left">Chaotic, Friendly, Hostile, Neutral</td>
</tr>
<tr valign="top">
<td align="left">system</td>
<td align="left">varchar(16)</td>
<td align="left"> </td>
<td align="left">Homeworld</td>
</tr>
<tr valign="top">
<td align="left">area</td>
<td align="left">varchar(16)</td>
<td align="left"> </td>
<td align="left">Engineering, Medical, Science, Weaponry</td>
</tr>
<tr valign="top">
<td align="left">skilllevel</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
</table>
<hr>
<h3><a name="t4">TABLE allships</a></h3>
<p>For every ship that's ever been seen in DOW on or before the given turn, list the ships status (one of Alien, Player, Retired). It is much faster to store this info once than to generate it each time.<p>
<table border="1">
<caption>Table "public.allships"</caption>
<tr>
<th align="center">Column</th>
<th align="center">Type</th>
<th align="center">Modifiers</th>
<th align="center">Description</th>
</tr>
<tr valign="top">
<td align="left">turn</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">ship</td>
<td align="left">varchar(64)</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">type</td>
<td align="left">varchar(16)</td>
<td align="left"> </td>
<td align="left">One of Alien, Player, Retired</td>
</tr>
</table>
<hr>
<h3><a name="t5">TABLE artifacts</a></h3>
<p>Artifacts carried by donors. I should have used ship name instead of donorid. Curses are stored in TABLE curses, with a reference to the artifactid. Keys are stored in TABLE keys, with a reference to the artifactid.<p>
<table border="1">
<caption>Table "public.artifacts"</caption>
<tr>
<th align="center">Column</th>
<th align="center">Type</th>
<th align="center">Modifiers</th>
<th align="center">Description</th>
</tr>
<tr valign="top">
<td align="left">artifactid</td>
<td align="left">integer</td>
<td align="left">not null default nextval('public.artifacts_artifactid_seq'::text)</td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">donorid</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">turn</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">name</td>
<td align="left">varchar(16)</td>
<td align="left"> </td>
<td align="left">e.g. Blocabaga</td>
</tr>
<tr valign="top">
<td align="left">bless</td>
<td align="left">character(2)</td>
<td align="left"> </td>
<td align="left">One of Cl, Id, Ls, Sb, Sh, Sn, Wd, Wp</td>
</tr>
</table>
<p>Indexes:<br />
"artifact_index1" btree (artifactid)<br />
"artifact_index2" btree (turn)<br />
</p>
<hr>
<h3><a name="t6">TABLE badland</a></h3>
<p>Stores the danger level for each badland. Not currently used by anything.<p>
<table border="1">
<caption>Table "public.badland"</caption>
<tr>
<th align="center">Column</th>
<th align="center">Type</th>
<th align="center">Modifiers</th>
<th align="center">Description</th>
</tr>
<tr valign="top">
<td align="left">id</td>
<td align="left">integer</td>
<td align="left">not null default nextval('public.badland_id_seq'::text)</td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">danger</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">system</td>
<td align="left">varchar(16)</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
</table>
<hr>
<h3><a name="t7">TABLE banned</a></h3>
<p>Which ships are banned from dow, when they were banned, etc.<p>
<table border="1">
<caption>Table "public.banned"</caption>
<tr>
<th align="center">Column</th>
<th align="center">Type</th>
<th align="center">Modifiers</th>
<th align="center">Description</th>
</tr>
<tr valign="top">
<td align="left">ship</td>
<td align="left">varchar(64)</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">turn</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">action</td>
<td align="left">varchar(32)</td>
<td align="left"> </td>
<td align="left">One Banned or Permaban (there is no longer any distinction between the two).</td>
</tr>
<tr valign="top">
<td align="left">description</td>
<td align="left">text</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
</table>
<hr>
<h3><a name="t8">TABLE colonies</a></h3>
<p>Stores info about each colony.<p>
<table border="1">
<caption>Table "public.colonies"</caption>
<tr>
<th align="center">Column</th>
<th align="center">Type</th>
<th align="center">Modifiers</th>
<th align="center">Description</th>
</tr>
<tr valign="top">
<td align="left">id</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left">Unique id for each colony</td>
</tr>
<tr valign="top">
<td align="left">system</td>
<td align="left">varchar(16)</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">race</td>
<td align="left">varchar(16)</td>
<td align="left"> </td>
<td align="left">e.g. Cat, Goblin</td>
</tr>
<tr valign="top">
<td align="left">resource</td>
<td align="left">varchar(32)</td>
<td align="left"> </td>
<td align="left">e.g. Old Songs, Mittens</td>
</tr>
</table>
<hr>
<h3><a name="t9">TABLE corona</a></h3>
<p>Stores the danger level of each Stellar Corona. Not currently used by anything.<p>
<table border="1">
<caption>Table "public.corona"</caption>
<tr>
<th align="center">Column</th>
<th align="center">Type</th>
<th align="center">Modifiers</th>
<th align="center">Description</th>
</tr>
<tr valign="top">
<td align="left">id</td>
<td align="left">integer</td>
<td align="left">not null default nextval('public.corona_id_seq'::text)</td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">danger</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">system</td>
<td align="left">varchar(16)</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
</table>
<hr>
<h3><a name="t10">TABLE criminals</a></h3>
<p>Records where criminals have been seen. Note that just because you know a criminal is in a location, you cannot necessarily pick him up. I believe you personally need to have been the one to gain the information about his location.<p>
<table border="1">
<caption>Table "public.criminals"</caption>
<tr>
<th align="center">Column</th>
<th align="center">Type</th>
<th align="center">Modifiers</th>
<th align="center">Description</th>
</tr>
<tr valign="top">
<td align="left">who</td>
<td align="left">varchar(16)</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">level</td>
<td align="left">varchar(16)</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">location</td>
<td align="left">varchar(16)</td>
<td align="left"> </td>
<td align="left">e.g. homeworld, moon, colony</td>
</tr>
<tr valign="top">
<td align="left">system</td>
<td align="left">varchar(16)</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">turn</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
</table>
<hr>
<h3><a name="t11">TABLE curses</a></h3>
<p>Stores the curses on all artifacts. The artifactid is a reference to an entry in TABLE artifacts.<p>
<table border="1">
<caption>Table "public.curses"</caption>
<tr>
<th align="center">Column</th>
<th align="center">Type</th>
<th align="center">Modifiers</th>
<th align="center">Description</th>
</tr>
<tr valign="top">
<td align="left">artifactid</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left">Reference to entry in TABLE artifacts.</td>
</tr>
<tr valign="top">
<td align="left">curse</td>
<td align="left">character(2)</td>
<td align="left"> </td>
<td align="left">One of Cl, Id, Ls, Sb, Sh, Sn, Wd, Wp</td>
</tr>
</table>
<hr>
<h3><a name="t12">TABLE customsetprefs</a></h3>
<p>Settings for the Custom Set. Values should have been floats instead of ints.<p>
<table border="1">
<caption>Table "public.customsetprefs"</caption>
<tr>
<th align="center">Column</th>
<th align="center">Type</th>
<th align="center">Modifiers</th>
<th align="center">Description</th>
</tr>
<tr valign="top">
<td align="left">donorid</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">sn</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left">Starnet</td>
</tr>
<tr valign="top">
<td align="left">usn</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left">Unaccessed starnet</td>
</tr>
<tr valign="top">
<td align="left">hw</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left">Homeworld</td>
</tr>
<tr valign="top">
<td align="left">hwup</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left">Homeworld with uncured plague</td>
</tr>
<tr valign="top">
<td align="left">hwne</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left">Homeworld of non-enemy alien</td>
</tr>
<tr valign="top">
<td align="left">factory</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">cfactory</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left">Contraband factory</td>
</tr>
<tr valign="top">
<td align="left">erogue</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left">Engineering rogue band</td>
</tr>
<tr valign="top">
<td align="left">srogue</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left">Science rogue band</td>
</tr>
<tr valign="top">
<td align="left">mrogue</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left">Medical rogue band</td>
</tr>
<tr valign="top">
<td align="left">wrogue</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left">Weaponry rogue band</td>
</tr>
<tr valign="top">
<td align="left">jumpcost</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">resources</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr valign="top">
<td align="left">hiringhall</td>
<td align="left">integer</td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr valign="top">