/
tables.json
3713 lines (3713 loc) 路 103 KB
/
tables.json
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
[
{
"name": "site_identifiers",
"comment": "Links local site identifiers to their corresponding site.",
"columns": [
{
"name": "si_type",
"comment": "local key type, ie 'interwiki' or 'langlink'",
"type": "binary",
"options": { "length": 32, "notnull": true }
},
{
"name": "si_key",
"comment": "local key value, ie 'en' or 'wiktionary'",
"type": "binary",
"options": { "length": 32, "notnull": true }
},
{
"name": "si_site",
"comment": "Key on sites.site_id",
"type": "integer",
"options": { "unsigned": true, "notnull": true }
}
],
"indexes": [
{ "name": "si_site", "columns": [ "si_site" ], "unique": false },
{ "name": "si_key", "columns": [ "si_key" ], "unique": false }
],
"pk": [ "si_type", "si_key" ]
},
{
"name": "updatelog",
"comment": "A table to log updates, one text key row per update.",
"columns": [
{
"name": "ul_key",
"type": "string",
"options": { "length": 255, "notnull": true }
},
{
"name": "ul_value",
"type": "blob",
"options": { "length": 65530, "notnull": false }
}
],
"indexes": [],
"pk": [ "ul_key" ]
},
{
"name": "actor",
"comment": "The \"actor\" table associates user names or IP addresses with integers for the benefit of other tables that need to refer to either logged-in or logged-out users. If something can only ever be done by logged-in users, it can refer to the user table directly.",
"columns": [
{
"name": "actor_id",
"comment": "Unique ID to identify each actor",
"type": "bigint",
"options": { "unsigned": true, "notnull": true, "autoincrement": true }
},
{
"name": "actor_user",
"comment": "Key to user.user_id, or NULL for anonymous edits",
"type": "integer",
"options": { "unsigned": true, "notnull": false }
},
{
"name": "actor_name",
"comment": "Text username or IP address",
"type": "binary",
"options": { "length": 255, "notnull": true }
}
],
"indexes": [
{ "name": "actor_user", "columns": [ "actor_user" ], "unique": true },
{ "name": "actor_name", "columns": [ "actor_name" ], "unique": true }
],
"pk": [ "actor_id" ]
},
{
"name": "user_former_groups",
"comment": "Stores the groups the user has once belonged to. The user may still belong to these groups (check user_groups). Autopromotion of users to groups from which they were removed can be restricted by using wgAutopromoteOnce instead of wgAutopromote.",
"columns": [
{
"name": "ufg_user",
"comment": "Key to user_id",
"type": "integer",
"options": { "unsigned": true, "notnull": true, "default": 0 }
},
{
"name": "ufg_group",
"type": "binary",
"options": { "length": 255, "notnull": true, "default": "" }
}
],
"indexes": [],
"pk": [ "ufg_user", "ufg_group" ]
},
{
"name": "bot_passwords",
"comment": "This table contains a user's bot passwords: passwords that allow access to the account via the API with limited rights.",
"columns": [
{
"name": "bp_user",
"comment": "User ID obtained from CentralIdLookup.",
"type": "integer",
"options": { "unsigned": true, "notnull": true }
},
{
"name": "bp_app_id",
"comment": "Application identifier.",
"type": "binary",
"options": { "length": 32, "notnull": true }
},
{
"name": "bp_password",
"comment": "Password hashes, like user.user_password.",
"type": "blob",
"options": { "length": 255, "notnull": true }
},
{
"name": "bp_token",
"comment": "Like user.user_token",
"type": "binary",
"options": { "length": 32, "notnull": true, "default": "", "fixed": true }
},
{
"name": "bp_restrictions",
"comment": "JSON blob for MWRestrictions",
"type": "blob",
"options": { "length": 65535, "notnull": true }
},
{
"name": "bp_grants",
"comment": "Grants allowed to the account when authenticated with this bot-password",
"type": "blob",
"options": { "length": 65535, "notnull": true }
}
],
"indexes": [],
"pk": [ "bp_user", "bp_app_id" ]
},
{
"name": "comment",
"comment": "Edits, blocks, and other actions typically have a textual comment describing the action. They are stored here to reduce the size of the main tables, and to allow for deduplication. Deduplication is currently best-effort to avoid locking on inserts that would be required for strict deduplication. There MAY be multiple rows with the same comment_text and comment_data.",
"columns": [
{
"name": "comment_id",
"comment": "Unique ID to identify each comment",
"type": "bigint",
"options": { "unsigned": true, "notnull": true, "autoincrement": true }
},
{
"name": "comment_hash",
"comment": "Hash of comment_text and comment_data, for deduplication",
"type": "integer",
"options": { "notnull": true }
},
{
"name": "comment_text",
"comment": "Text comment summarizing the change. This text is shown in the history and other changes lists, rendered in a subset of wiki markup by MediaWiki\\CommentFormatter\\CommentFormatter::format(). Size limits are enforced at the application level, and should take care to crop UTF-8 strings appropriately.",
"type": "blob",
"options": { "length": 65535, "notnull": true }
},
{
"name": "comment_data",
"comment": "JSON data, intended for localizing auto-generated comments. This holds structured data that is intended to be used to provide localized versions of automatically-generated comments. When not empty, comment_text should be the generated comment localized using the wiki's content language.",
"type": "blob",
"options": { "length": 65535, "notnull": false }
}
],
"indexes": [
{ "name": "comment_hash", "columns": [ "comment_hash" ], "unique": false }
],
"pk": [ "comment_id" ]
},
{
"name": "slots",
"comment": "Slots represent an n:m relation between revisions and content objects. A content object can have a specific \"role\" in one or more revisions. Each revision can have multiple content objects, each having a different role.",
"columns": [
{
"name": "slot_revision_id",
"comment": "reference to rev_id or ar_rev_id",
"type": "bigint",
"options": { "unsigned": true, "notnull": true }
},
{
"name": "slot_role_id",
"comment": "reference to role_id",
"type": "smallint",
"options": { "unsigned": true, "notnull": true }
},
{
"name": "slot_content_id",
"comment": "reference to content_id",
"type": "bigint",
"options": { "unsigned": true, "notnull": true }
},
{
"name": "slot_origin",
"comment": "The revision ID of the revision that originated the slot's content. To find revisions that changed slots, look for slot_origin = slot_revision_id. TODO: Is that actually true? Rollback seems to violate it by setting slot_origin to an older rev_id. Undeletions could result in the same situation.",
"type": "bigint",
"options": { "unsigned": true, "notnull": true }
}
],
"indexes": [
{
"name": "slot_revision_origin_role",
"columns": [ "slot_revision_id", "slot_origin", "slot_role_id" ],
"comment": "Index for finding revisions that modified a specific slot",
"unique": false
}
],
"pk": [ "slot_revision_id", "slot_role_id" ]
},
{
"name": "site_stats",
"comment": "Contains a single row with some aggregate info on the state of the site.",
"columns": [
{
"name": "ss_row_id",
"comment": "The single row should contain 1 here.",
"type": "integer",
"options": { "unsigned": true, "notnull": true }
},
{
"name": "ss_total_edits",
"comment": "Total number of edits performed.",
"type": "bigint",
"options": { "unsigned": true, "notnull": false, "default": null }
},
{
"name": "ss_good_articles",
"comment": "See SiteStatsInit::articles().",
"type": "bigint",
"options": { "unsigned": true, "notnull": false, "default": null }
},
{
"name": "ss_total_pages",
"comment": "Total pages, theoretically equal to SELECT COUNT(*) FROM page.",
"type": "bigint",
"options": { "unsigned": true, "notnull": false, "default": null }
},
{
"name": "ss_users",
"comment": "Number of users, theoretically equal to SELECT COUNT(*) FROM user.",
"type": "bigint",
"options": { "unsigned": true, "notnull": false, "default": null }
},
{
"name": "ss_active_users",
"comment": "Number of users that still edit.",
"type": "bigint",
"options": { "unsigned": true, "notnull": false, "default": null }
},
{
"name": "ss_images",
"comment": "Number of images, equivalent to SELECT COUNT(*) FROM image.",
"type": "bigint",
"options": { "unsigned": true, "notnull": false, "default": null }
}
],
"indexes": [],
"pk": [ "ss_row_id" ]
},
{
"name": "user_properties",
"comment": "User preferences and perhaps other fun stuff. :) Replaces the old user.user_options blob, with a couple nice properties: 1) We only store non-default settings, so changes to the defaults are now reflected for everybody, not just new accounts. 2) We can more easily do bulk lookups, statistics, or modifications of saved options since it's a sensible table structure.",
"columns": [
{
"name": "up_user",
"comment": "Foreign key to user.user_id",
"type": "integer",
"options": { "unsigned": true, "notnull": true }
},
{
"name": "up_property",
"comment": "Name of the option being saved. This is indexed for bulk lookup.",
"type": "binary",
"options": { "length": 255, "notnull": true }
},
{
"name": "up_value",
"comment": "Property value as a string.",
"type": "blob",
"options": { "length": 65530, "notnull": false }
}
],
"indexes": [
{ "name": "up_property", "columns": [ "up_property" ], "unique": false }
],
"pk": [ "up_user", "up_property" ]
},
{
"name": "log_search",
"columns": [
{
"name": "ls_field",
"comment": "The type of ID (rev ID, log ID, rev timestamp, username)",
"type": "binary",
"options": { "length": 32, "notnull": true }
},
{
"name": "ls_value",
"comment": "The value of the ID",
"type": "string",
"options": { "length": 255, "notnull": true }
},
{
"name": "ls_log_id",
"comment": "Key to log_id",
"type": "integer",
"options": { "unsigned": true, "notnull": true, "default": 0 }
}
],
"indexes": [
{ "name": "ls_log_id", "columns": [ "ls_log_id" ], "unique": false }
],
"pk": [ "ls_field", "ls_value", "ls_log_id" ]
},
{
"name": "change_tag",
"comment": "A table to track tags for revisions, logs and recent changes",
"columns": [
{
"name": "ct_id",
"type": "integer",
"options": { "unsigned": true, "notnull": true, "autoincrement": true }
},
{
"name": "ct_rc_id",
"comment": "RCID for the change",
"type": "integer",
"options": { "unsigned": true, "notnull": false, "default": null }
},
{
"name": "ct_log_id",
"comment": "LOGID for the change",
"type": "integer",
"options": { "unsigned": true, "notnull": false, "default": null }
},
{
"name": "ct_rev_id",
"comment": "REVID for the change",
"type": "integer",
"options": { "unsigned": true, "notnull": false, "default": null }
},
{
"name": "ct_params",
"comment": "Parameters for the tag; used by some extensions",
"type": "blob",
"options": { "length": 65530, "notnull": false, "default": null }
},
{
"name": "ct_tag_id",
"comment": "Foreign key to change_tag_def row",
"type": "integer",
"options": { "unsigned": true, "notnull": true }
}
],
"indexes": [
{ "name": "ct_rc_tag_id", "columns": [ "ct_rc_id", "ct_tag_id" ], "unique": true },
{ "name": "ct_log_tag_id", "columns": [ "ct_log_id", "ct_tag_id" ], "unique": true },
{ "name": "ct_rev_tag_id", "columns": [ "ct_rev_id", "ct_tag_id" ], "unique": true },
{
"name": "ct_tag_id_id",
"comment": "Covering index, so we can pull all the info only out of the index.",
"columns": [ "ct_tag_id", "ct_rc_id", "ct_rev_id", "ct_log_id" ],
"unique": false
}
],
"pk": [ "ct_id" ]
},
{
"name": "content",
"comment": "The content table represents content objects. It's primary purpose is to provide the necessary meta-data for loading and interpreting a serialized data blob to create a content object.",
"columns": [
{
"name": "content_id",
"comment": "ID of the content object",
"type": "bigint",
"options": { "notnull": true, "unsigned": true, "autoincrement": true }
},
{
"name": "content_size",
"comment": "Nominal size of the content object (not necessarily of the serialized blob)",
"type": "integer",
"options": { "notnull": true, "unsigned": true }
},
{
"name": "content_sha1",
"comment": "Nominal hash of the content object (not necessarily of the serialized blob)",
"type": "binary",
"options": { "notnull": true, "length": 32 }
},
{
"name": "content_model",
"comment": "reference to model_id. Note the content format isn't specified; it should be assumed to be in the default format for the model unless auto-detected otherwise.",
"type": "smallint",
"options": { "notnull": true, "unsigned": true }
},
{
"name": "content_address",
"comment": "URL-like address of the content blob",
"type": "binary",
"options": { "notnull": true, "length": 255 }
}
],
"indexes": [],
"pk": [ "content_id" ]
},
{
"name": "l10n_cache",
"comment": "Table for storing localisation data",
"columns": [
{
"name": "lc_lang",
"comment": "Language code",
"type": "binary",
"options": { "notnull": true, "length": 35 }
},
{
"name": "lc_key",
"comment": "Cache key",
"type": "string",
"options": { "notnull": true, "length": 255 }
},
{
"name": "lc_value",
"comment": "Value",
"type": "blob",
"options": { "notnull": true, "length": 16777215 }
}
],
"indexes": [],
"pk": [ "lc_lang", "lc_key" ]
},
{
"name": "module_deps",
"comment": "Table caching which local files a module depends on that aren't registered directly, used for fast retrieval of file dependency. Currently only used for tracking images that CSS depends on",
"columns": [
{
"name": "md_module",
"comment": "Module name",
"type": "binary",
"options": { "notnull": true, "length": 255 }
},
{
"name": "md_skin",
"comment": "Module context vary (includes skin and language; called \"md_skin\" for legacy reasons)",
"type": "binary",
"options": { "notnull": true, "length": 32 }
},
{
"name": "md_deps",
"comment": "JSON blob with file dependencies",
"type": "blob",
"options": { "notnull": true, "length": 16777215 }
}
],
"indexes": [],
"pk": [ "md_module", "md_skin" ]
},
{
"name": "redirect",
"comment": "For each redirect, this table contains exactly one row defining its target.\nRedirect targets are key to page_namespace/page_title of the target page.\nThe target page may or may not exist, and due to renames\nand deletions may refer to different page records as time\ngoes by.",
"columns": [
{
"name": "rd_from",
"comment": "Key to the page_id of the redirect page",
"type": "integer",
"options": { "notnull": true, "unsigned": true, "default": 0 }
},
{
"name": "rd_namespace",
"type": "integer",
"options": { "notnull": true, "default": 0 }
},
{
"name": "rd_title",
"type": "binary",
"options": { "notnull": true, "length": 255, "default": "" }
},
{
"name": "rd_interwiki",
"type": "string",
"options": { "notnull": false, "length": 32, "default": null }
},
{
"name": "rd_fragment",
"type": "binary",
"options": { "notnull": false, "length": 255, "default": null }
}
],
"indexes": [
{ "name": "rd_ns_title", "columns": [ "rd_namespace", "rd_title", "rd_from" ], "unique": false }
],
"pk": [ "rd_from" ]
},
{
"name": "pagelinks",
"comment": "Track page-to-page hyperlinks within the wiki. The target page may or may not exist, and due to renames and deletions may refer to different page records as time goes by.",
"columns": [
{
"name": "pl_from",
"comment": "Key to the page_id of the page containing the link.",
"type": "integer",
"options": { "notnull": true, "unsigned": true, "default": 0 }
},
{
"name": "pl_namespace",
"type": "integer",
"options": { "notnull": true, "default": 0 }
},
{
"name": "pl_title",
"type": "binary",
"options": { "notnull": true, "length": 255, "default": "" }
},
{
"name": "pl_from_namespace",
"type": "integer",
"comment": "Namespace for pl_from page",
"options": { "notnull": true, "default": 0 }
}
],
"indexes": [
{
"name": "pl_namespace",
"columns": [ "pl_namespace", "pl_title", "pl_from" ],
"comment": "Reverse index, for Special:Whatlinkshere",
"unique": false
},
{
"name": "pl_backlinks_namespace",
"columns": [ "pl_from_namespace", "pl_namespace", "pl_title", "pl_from" ],
"comment": "Index for Special:Whatlinkshere with namespace filter",
"unique": false
}
],
"pk": [ "pl_from", "pl_namespace", "pl_title" ]
},
{
"name": "templatelinks",
"comment": "Track template inclusions. The target page may or may not exist, and due to renames and deletions may refer to different page records as time goes by.",
"columns": [
{
"name": "tl_from",
"comment": "Key to the page_id of the page containing the link.",
"type": "integer",
"options": { "notnull": true, "unsigned": true, "default": 0 }
},
{
"name": "tl_from_namespace",
"type": "integer",
"comment": "Namespace for this page",
"options": { "notnull": true, "default": 0 }
},
{
"name": "tl_target_id",
"type": "bigint",
"comment": "Foreign key to linktarget.lt_id",
"options": { "notnull": true, "unsigned": true }
}
],
"indexes": [
{
"name": "tl_target_id",
"columns": [ "tl_target_id", "tl_from" ],
"comment": "Reverse index, for Special:Whatlinkshere",
"unique": false
},
{
"name": "tl_backlinks_namespace_target_id",
"columns": [ "tl_from_namespace", "tl_target_id", "tl_from" ],
"comment": "Index for Special:Whatlinkshere with namespace filter",
"unique": false
}
],
"pk": [ "tl_from", "tl_target_id" ]
},
{
"name": "imagelinks",
"comment": "Track links to images *used inline* We don't distinguish live from broken links here, so they do not need to be changed on upload/removal.",
"columns": [
{
"name": "il_from",
"comment": "Key to page_id of the page containing the image / media link.",
"type": "integer",
"options": { "notnull": true, "unsigned": true, "default": 0 }
},
{
"name": "il_from_namespace",
"type": "integer",
"comment": "Namespace for this page",
"options": { "notnull": true, "default": 0 }
},
{
"name": "il_to",
"type": "binary",
"comment": "Filename of target image. This is also the page_title of the file's description page; all such pages are in namespace 6 (NS_FILE).",
"options": { "notnull": true, "length": 255, "default": "" }
}
],
"indexes": [
{
"name": "il_to",
"columns": [ "il_to", "il_from" ],
"comment": "Reverse index, for Special:Whatlinkshere and file description page local usage",
"unique": false
},
{
"name": "il_backlinks_namespace",
"columns": [ "il_from_namespace", "il_to", "il_from" ],
"comment": "Index for Special:Whatlinkshere with namespace filter",
"unique": false
}
],
"pk": [ "il_from", "il_to" ]
},
{
"name": "langlinks",
"comment": "Track interlanguage links.",
"columns": [
{
"name": "ll_from",
"comment": "page_id of the referring page",
"type": "integer",
"options": { "notnull": true, "unsigned": true, "default": 0 }
},
{
"name": "ll_lang",
"type": "binary",
"comment": "Language code of the target",
"options": { "notnull": true, "length": 35, "default": "" }
},
{
"name": "ll_title",
"type": "binary",
"comment": "Title of the target, including namespace",
"options": { "notnull": true, "length": 255, "default": "" }
}
],
"indexes": [
{
"name": "ll_lang",
"columns": [ "ll_lang", "ll_title" ],
"comment": "Index for ApiQueryLangbacklinks",
"unique": false
}
],
"pk": [ "ll_from", "ll_lang" ]
},
{
"name": "iwlinks",
"comment": "Track inline interwiki links",
"columns": [
{
"name": "iwl_from",
"comment": "page_id of the referring page",
"type": "integer",
"options": { "notnull": true, "unsigned": true, "default": 0 }
},
{
"name": "iwl_prefix",
"type": "binary",
"comment": "Interwiki prefix code of the target",
"options": { "notnull": true, "length": 32, "default": "" }
},
{
"name": "iwl_title",
"type": "binary",
"comment": "Title of the target, including namespace",
"options": { "notnull": true, "length": 255, "default": "" }
}
],
"indexes": [
{
"name": "iwl_prefix_title_from",
"columns": [ "iwl_prefix", "iwl_title", "iwl_from" ],
"comment": "Index for ApiQueryIWBacklinks",
"unique": false
},
{
"name": "iwl_prefix_from_title",
"columns": [ "iwl_prefix", "iwl_from", "iwl_title" ],
"comment": "Index for ApiQueryIWLinks",
"unique": false
}
],
"pk": [ "iwl_from", "iwl_prefix", "iwl_title" ]
},
{
"name": "category",
"comment": "Track all existing categories. Something is a category if 1) it has an entry somewhere in categorylinks, or 2) it has a description page. Categories might not have corresponding pages, so they need to be tracked separately. The numbers of member pages (including categories and media), subcategories, and Image: namespace members, respectively are included in this table too. These are signed to make underflow more obvious. We make the first number include the second two for better sorting: subtracting for display is easy, adding for ordering is not.",
"columns": [
{
"name": "cat_id",
"comment": "Primary key",
"type": "integer",
"options": { "notnull": true, "unsigned": true, "autoincrement": true }
},
{
"name": "cat_title",
"type": "binary",
"comment": "Name of the category, in the same form as page_title (with underscores). If there is a category page corresponding to this category, by definition, it has this name (in the Category namespace).",
"options": { "notnull": true, "length": 255 }
},
{
"name": "cat_pages",
"type": "integer",
"options": { "notnull": true, "default": 0 }
},
{
"name": "cat_subcats",
"type": "integer",
"options": { "notnull": true, "default": 0 }
},
{
"name": "cat_files",
"type": "integer",
"options": { "notnull": true, "default": 0 }
}
],
"indexes": [
{
"name": "cat_title",
"columns": [ "cat_title" ],
"unique": true
},
{
"name": "cat_pages",
"columns": [ "cat_pages" ],
"comment": "For Special:Mostlinkedcategories",
"unique": false
}
],
"pk": [ "cat_id" ]
},
{
"name": "watchlist_expiry",
"comment": "Allows setting an expiry for watchlist items.",
"columns": [
{
"name": "we_item",
"comment": "Key to watchlist.wl_id",
"type": "integer",
"options": { "notnull": true, "unsigned": true }
},
{
"name": "we_expiry",
"type": "mwtimestamp",
"comment": "Expiry time",
"options": { "notnull": true }
}
],
"indexes": [
{
"name": "we_expiry",
"columns": [ "we_expiry" ],
"unique": false
}
],
"pk": [ "we_item" ]
},
{
"name": "change_tag_def",
"comment": "Table defining tag names for IDs. Also stores hit counts to avoid expensive queries on change_tag",
"columns": [
{
"name": "ctd_id",
"comment": "Numerical ID of the tag (ct_tag_id refers to this)",
"type": "integer",
"options": { "unsigned": true, "notnull": true, "autoincrement": true }
},
{
"name": "ctd_name",
"comment": "Symbolic name of the tag (what would previously be put in ct_tag)",
"type": "binary",
"options": { "length": 255, "notnull": true }
},
{
"name": "ctd_user_defined",
"comment": "Whether this tag was defined manually by a privileged user using Special:Tags",
"type": "mwtinyint",
"options": { "notnull": true, "length": 1 }
},
{
"name": "ctd_count",
"comment": "Number of times this tag was used",
"type": "bigint",
"options": { "unsigned": true, "notnull": true, "default": 0 }
}
],
"indexes": [
{ "name": "ctd_name", "columns": [ "ctd_name" ], "unique": true },
{ "name": "ctd_count", "columns": [ "ctd_count" ], "unique": false },
{ "name": "ctd_user_defined", "columns": [ "ctd_user_defined" ], "unique": false }
],
"pk": [ "ctd_id" ]
},
{
"name": "ipblocks_restrictions",
"comment": "Partial Block Restrictions",
"columns": [
{
"name": "ir_ipb_id",
"comment": "The ipb_id from ipblocks",
"type": "integer",
"options": { "notnull": true, "unsigned": true }
},
{
"name": "ir_type",
"comment": "The restriction type id.",
"type": "mwtinyint",
"options": { "notnull": true, "length": 4 }
},
{
"name": "ir_value",
"comment": "The restriction id that corresponds to the type. Typically a Page ID or a Namespace ID.",
"type": "integer",
"options": { "notnull": true, "unsigned": true }
}
],
"indexes": [
{
"name": "ir_type_value",
"comment": "Index to query restrictions by the page or namespace.",
"columns": [ "ir_type", "ir_value" ],
"unique": false
}
],
"pk": [ "ir_ipb_id", "ir_type", "ir_value" ]
},
{
"name": "querycache",
"comment": "Used for caching expensive grouped queries",
"columns": [
{
"name": "qc_type",
"comment": "A key name, generally the base name of of the special page",
"type": "binary",
"options": { "length": 32, "notnull": true }
},
{
"name": "qc_value",
"comment": "Some sort of stored value. Sizes, counts...",
"type": "integer",
"options": { "notnull": true, "unsigned": true, "default": 0 }
},
{
"name": "qc_namespace",
"type": "integer",
"options": { "notnull": true, "default": 0 }
},
{
"name": "qc_title",
"type": "binary",
"options": { "length": 255, "notnull": true, "default": "" }
}
],
"indexes": [
{ "name": "qc_type", "columns": [ "qc_type", "qc_value" ], "unique": false }
],
"pk": []
},
{
"name": "querycachetwo",
"comment": "Used for caching expensive grouped queries that need two links (for example double-redirects)",
"columns": [
{
"name": "qcc_type",
"comment": "A key name, generally the base name of of the special page.",
"type": "binary",
"options": { "length": 32, "notnull": true }
},
{
"name": "qcc_value",
"comment": "Some sort of stored value. Sizes, counts...",
"type": "integer",
"options": { "notnull": true, "unsigned": true, "default": 0 }
},
{
"name": "qcc_namespace",
"type": "integer",
"options": { "notnull": true, "default": 0 }
},
{
"name": "qcc_title",
"type": "binary",
"options": { "length": 255, "notnull": true, "default": "" }
},
{
"name": "qcc_namespacetwo",
"type": "integer",
"options": { "notnull": true, "default": 0 }
},
{
"name": "qcc_titletwo",
"type": "binary",
"options": { "length": 255, "notnull": true, "default": "" }
}
],
"indexes": [
{ "name": "qcc_type", "columns": [ "qcc_type", "qcc_value" ], "unique": false },
{ "name": "qcc_title", "columns": [ "qcc_type", "qcc_namespace", "qcc_title" ], "unique": false },
{ "name": "qcc_titletwo", "columns": [ "qcc_type", "qcc_namespacetwo", "qcc_titletwo" ], "unique": false }
],
"pk": []
},
{
"name": "page_restrictions",
"comment": "Used for storing page restrictions (i.e. protection levels)",
"columns": [
{
"name": "pr_id",
"comment": "Field for an ID for this restrictions row (sort-key for Special:ProtectedPages)",
"type": "integer",
"options": { "unsigned": true, "notnull": true, "autoincrement": true }
},
{
"name": "pr_page",
"comment": "Page to apply restrictions to (Foreign Key to page).",
"type": "integer",
"options": { "notnull": true, "unsigned": true }
},
{
"name": "pr_type",
"comment": "The protection type (edit, move, etc)",
"type": "binary",
"options": { "length": 60, "notnull": true }
},
{
"name": "pr_level",
"comment": "The protection level (Sysop, autoconfirmed, etc)",
"type": "binary",
"options": { "length": 60, "notnull": true }
},
{
"name": "pr_cascade",
"type": "mwtinyint",
"options": { "notnull": true }
},
{
"name": "pr_expiry",
"comment": "Field for time-limited protection.",
"type": "mwtimestamp",
"options": {
"notnull": false,
"CustomSchemaOptions": {
"allowInfinite": true
}
}
}
],
"indexes": [
{ "name": "pr_pagetype", "columns": [ "pr_page", "pr_type" ], "unique": true },
{ "name": "pr_typelevel", "columns": [ "pr_type", "pr_level" ], "unique": false },
{ "name": "pr_level", "columns": [ "pr_level" ], "unique": false },
{ "name": "pr_cascade", "columns": [ "pr_cascade" ], "unique": false }
],
"pk": [ "pr_id" ]
},
{
"name": "user_groups",
"comment": "User permissions have been broken out to a separate table; this allows sites with a shared user table to have different permissions assigned to a user in each project. This table replaces the old user_rights field which used a comma-separated blob.",
"columns": [
{
"name": "ug_user",
"comment": "Key to user_id",
"type": "integer",
"options": { "notnull": true, "unsigned": true, "default": 0 }
},
{
"name": "ug_group",
"comment": "Group names are short symbolic string keys. The set of group names is open-ended, though in practice only some predefined ones are likely to be used. At runtime $wgGroupPermissions will associate group keys with particular permissions. A user will have the combined permissions of any group they're explicitly in, plus the implicit '*' and 'user' groups.",
"type": "binary",
"options": { "length": 255, "notnull": true, "default": "" }
},
{
"name": "ug_expiry",
"comment": "Time at which the user group membership will expire. Set to NULL for a non-expiring (infinite) membership.",
"type": "mwtimestamp",
"options": {
"notnull": false,
"default": null,
"CustomSchemaOptions": {
"allowInfinite": true
}
}
}
],
"indexes": [
{ "name": "ug_group", "columns": [ "ug_group" ], "unique": false },
{ "name": "ug_expiry", "columns": [ "ug_expiry" ], "unique": false }
],
"pk": [ "ug_user", "ug_group" ]
},
{
"name": "querycache_info",
"comment": "Details of updates to cached special pages",
"columns": [