|
|
本館粉絲專頁 |
|
|
使用者:Minwei/維基筆記/Schema轉換/Tables need updated
目次 |
[編輯] Archive table
[編輯] 欄位
[編輯] ar_text
[編輯] ar_rev_id
[編輯] ar_text_id
[編輯] ar_deleted
[編輯] ar_len
[編輯] Schema summary
DESCRIBE archive in MediaWiki 1.10 gives the following:
mysql> describe mw_archive; +---------------+---------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------+---------------------+------+-----+---------+-------+ | ar_namespace | int(11) | NO | MUL | 0 | | | ar_title | varchar(255) | NO | | NULL | | | ar_text | mediumblob | NO | | NULL | | | ar_comment | tinyblob | NO | | NULL | | | ar_user | int(5) unsigned | NO | | 0 | | | ar_user_text | varchar(255) | NO | | NULL | | | ar_timestamp | char(14) | NO | | NULL | | | ar_minor_edit | tinyint(1) | NO | | 0 | | | ar_flags | tinyblob | NO | | NULL | | | ar_rev_id | int(8) unsigned | YES | | NULL | | | ar_text_id | int(8) unsigned | YES | | NULL | | | ar_deleted | tinyint(1) unsigned | NO | | 0 | | | ar_len | int(8) unsigned | YES | | NULL | | +---------------+---------------------+------+-----+---------+-------+ 13 rows in set (0.02 sec)
DESCRIBE archive in versions before 1.5 gives the following:
+---------------+---------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------+---------------------+------+-----+---------+-------+ | ar_namespace | tinyint(2) unsigned | | | 0 | | | ar_title | varchar(255) binary | | | | | | ar_text | mediumtext | | | | | | ar_comment | tinyblob | | | | | | ar_user | int(5) unsigned | | | 0 | | | ar_user_text | varchar(255) binary | | | | | | ar_timestamp | varchar(14) binary | | | | | | ar_minor_edit | tinyint(1) | | | 0 | | | ar_flags | tinyblob | | | | | +---------------+---------------------+------+-----+---------+-------+
[編輯] Image table
+-----------------+---------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------------+---------------------+------+-----+---------+-------+ | img_name | varchar(255) binary | | | | | | img_size | int(8) unsigned | | | 0 | | | img_description | tinyblob | | | | | | img_user | int(5) unsigned | | | 0 | | | img_user_text | varchar(255) binary | | | | | | img_timestamp | varchar(14) binary | | | | | +-----------------+---------------------+------+-----+---------+-------+
mysql> describe mw_image;
+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
| img_name | varchar(255) | NO | PRI | NULL | |
| img_size | int(8) unsigned | NO | MUL | 0 | |
| img_width | int(5) | NO | | 0 | |
| img_height | int(5) | NO | | 0 | |
| img_metadata | mediumblob | NO | | NULL | |
| img_bits | int(3) | NO | | 0 | |
| img_media_type | enum('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE') | YES | | NULL | |
| img_major_mime | enum('unknown','application','audio','image','text','video','message','model','multipart') | NO | | unknown | |
| img_minor_mime | varchar(32) | NO | | unknown | |
| img_description | tinyblob | NO | | NULL | |
| img_user | int(5) unsigned | NO | | 0 | |
| img_user_text | varchar(255) | NO | | NULL | |
| img_timestamp | char(14) | NO | MUL | NULL | |
+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
13 rows in set (0.00 sec)
[編輯] Interwiki table
- For example, the interwiki link fr: on the en.wikipedia.org project has iw_local=1 set. Therefore, the link to http://en.wikipedia.org/wiki/fr:Accueil gracefully redirects you to the French Homepage (Accueil). However, the Wikimedia foundation project site is flagged 0 on en.wikipedia.org; the link to http://en.wikipedia.org/wiki/wikimedia:Home does not work, even though [[wikimedia:Home]] would work if it were on a local Wikipedia page.
iw_trans: is used to allow transcluding templates (or other pages) from another MediaWiki installation. Both $wgEnableScaryTranscluding and iw_trans need to be on.
mysql> describe mw_interwiki; +-----------+------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------+------------+------+-----+---------+-------+ | iw_prefix | char(32) | NO | PRI | NULL | | | iw_url | char(127) | NO | | NULL | | | iw_local | tinyint(1) | NO | | NULL | | | iw_trans | tinyint(1) | NO | | 0 | | +-----------+------------+------+-----+---------+-------+ 4 rows in set (0.00 sec)
[編輯] Ipblocks table
+----------------------+-----------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------------------+-----------------+------+-----+---------+----------------+ | ipb_id | int(8) | NO | PRI | NULL | auto_increment | | ipb_address | varchar(40) | NO | MUL | NULL | | | ipb_user | int(8) unsigned | NO | MUL | 0 | | | ipb_by | int(8) unsigned | NO | | 0 | | | ipb_reason | tinyblob BINARY | NO | | NULL | | | ipb_timestamp | varchar(14) | NO | MUL | NULL | | | ipb_auto | tinyint(1) | NO | | 0 | | | ipb_anon_only | tinyint(1) | NO | | 0 | | | ipb_expiry | varchar(14) | NO | MUL | NULL | | +----------------------+-----------------+------+-----+---------+----------------+
mysql> describe mw_ipblocks; +----------------------+-----------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------------------+-----------------+------+-----+---------+----------------+ | ipb_id | int(8) | NO | PRI | NULL | auto_increment | | ipb_address | tinyblob | NO | MUL | NULL | | | ipb_user | int(8) unsigned | NO | MUL | 0 | | | ipb_by | int(8) unsigned | NO | | 0 | | | ipb_reason | tinyblob | NO | | NULL | | | ipb_timestamp | char(14) | NO | MUL | NULL | | | ipb_auto | tinyint(1) | NO | | 0 | | | ipb_anon_only | tinyint(1) | NO | | 0 | | | ipb_create_account | tinyint(1) | NO | | 1 | | | ipb_enable_autoblock | tinyint(1) | NO | | 1 | | | ipb_expiry | char(14) | NO | MUL | NULL | | | ipb_range_start | tinyblob | NO | MUL | NULL | | | ipb_range_end | tinyblob | NO | | NULL | | +----------------------+-----------------+------+-----+---------+----------------+ 13 rows in set (0.00 sec)
[編輯] Logging table
+---------------+------------------+------+-----+----------------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------+------------------+------+-----+----------------+-------+ | log_type | char(10) | NO | MUL | | | | log_action | char(10) | NO | | | | | log_timestamp | char(14) | NO | | 19700101000000 | | | log_user | int(10) unsigned | NO | MUL | 0 | | | log_namespace | int(11) | NO | MUL | 0 | | | log_title | varchar(255) | NO | | | | | log_comment | varchar(255) | NO | | | | | log_params | blob | NO | | | | +---------------+------------------+------+-----+----------------+-------+
mysql> describe mw_logging; +---------------+------------------+------+-----+----------------+----------------+ | Field | Type | Null | Key | Default | Extra | +---------------+------------------+------+-----+----------------+----------------+ | log_type | char(10) | NO | MUL | NULL | | | log_action | char(10) | NO | | NULL | | | log_timestamp | char(14) | NO | MUL | 19700101000000 | | | log_user | int(10) unsigned | NO | MUL | 0 | | | log_namespace | int(11) | NO | MUL | 0 | | | log_title | varchar(255) | NO | | NULL | | | log_comment | varchar(255) | NO | | NULL | | | log_params | blob | NO | | NULL | | | log_id | int(10) unsigned | NO | PRI | NULL | auto_increment | +---------------+------------------+------+-----+----------------+----------------+ 9 rows in set (0.02 sec)
[編輯] Objectcache table
+---------+---------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------+---------------------+------+-----+---------+-------+ | keyname | varchar(255) binary | | PRI | | | | value | mediumblob | YES | | NULL | | | exptime | datetime | YES | MUL | NULL | | +---------+---------------------+------+-----+---------+-------+
+---------+------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------+------------+------+-----+---------+-------+ | keyname | char(255) | NO | PRI | NULL | | | value | mediumblob | YES | | NULL | | | exptime | datetime | YES | MUL | NULL | | +---------+------------+------+-----+---------+-------+
[編輯] Oldimage table
+-----------------+---------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------------+---------------------+------+-----+---------+-------+ | oi_name | varchar(255) binary | | MUL | | | | oi_archive_name | varchar(255) binary | | | | | | oi_size | int(8) unsigned | | | 0 | | | oi_description | tinyblob | | | | | | oi_user | int(5) unsigned | | | 0 | | | oi_user_text | varchar(255) binary | | | | | | oi_timestamp | varchar(14) binary | | | | | +-----------------+---------------------+------+-----+---------+-------+
mysql> describe mw_oldimage; +-----------------+-----------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------------+-----------------+------+-----+---------+-------+ | oi_name | varchar(255) | NO | MUL | NULL | | | oi_archive_name | varchar(255) | NO | | NULL | | | oi_size | int(8) unsigned | NO | | 0 | | | oi_width | int(5) | NO | | 0 | | | oi_height | int(5) | NO | | 0 | | | oi_bits | int(3) | NO | | 0 | | | oi_description | tinyblob | NO | | NULL | | | oi_user | int(5) unsigned | NO | | 0 | | | oi_user_text | varchar(255) | NO | | NULL | | | oi_timestamp | char(14) | NO | | NULL | | +-----------------+-----------------+------+-----+---------+-------+ 10 rows in set (0.00 sec)
[編輯] Querycache table
+--------------+---------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------------+---------------------+------+-----+---------+-------+ | qc_type | char(32) | | MUL | | | | qc_value | int(5) unsigned | | | 0 | | | qc_namespace | tinyint(2) unsigned | | | 0 | | | qc_title | char(255) binary | | | | | +--------------+---------------------+------+-----+---------+-------+
+--------------+-----------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------------+-----------------+------+-----+---------+-------+ | qc_type | char(32) | NO | MUL | NULL | | | qc_value | int(5) unsigned | NO | | 0 | | | qc_namespace | int(11) | NO | | 0 | | | qc_title | char(255) | NO | | NULL | | +--------------+-----------------+------+-----+---------+-------+
- qc_namespace:tinyint(2) unsigned→int(11)
[編輯] Recentchanges table
[編輯] Fields
[編輯] rc_id
This is the primary key for the table. (Introduced in MediaWiki 1.5)
[編輯] rc_old_len
模板:MW 1.9 This field stores the size, in bytes, of previous revision's text. This field is used to generate the added and removed characters feature in recent changes, related changes and watchlists.
[編輯] rc_new_len
模板:MW 1.9 This field stores the size, in bytes, of the current revision's text. This field is used to generate the added and removed characters feature in recent changes, related changes and watchlists.
[編輯] rc_deleted
模板:MW 1.10 This field stores a value for this particular revision's visibility within the wiki. It was created to accommodate upcoming revisions to the deletion system. The field is analogous to rev_deleted.
[編輯] rc_log_id
模板:MW 1.10 This field is a foreign key to the logging table, which links to log_id if this row corresponds to a log entry. The field was introduced in MediaWiki 1.10.
[編輯] rc_log_type
模板:MW 1.10
If a log action is referenced in this row, this field stores the type of log action that was performed, and which is referenced in this row. Typical values are block, delete, import, makebot, move, newusers, protect, renameuser, rights, upload. This field is comparable to log_type.
[編輯] rc_log_action
模板:MW 1.10 If a log action is referenced in this row, this field stores the type of log action that was performed, and which is referenced in this row. This field is comparable to log_action.
[編輯] rc_params
模板:MW 1.10 This field will be a mirror of log_params, following the log_params text rewrite. Introduced in MediaWiki 1.10.
[編輯] Schema summary
模板:MW 1.10 DESCRIBE recentchanges in MediaWiki 1.10 gives the following:
mysql> describe mw_recentchanges; +-------------------+---------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------------+---------------------+------+-----+---------+----------------+ | rc_id | int(8) | NO | PRI | NULL | auto_increment | | rc_timestamp | varchar(14) | NO | MUL | NULL | | | rc_cur_time | varchar(14) | NO | | NULL | | | rc_user | int(10) unsigned | NO | | 0 | | | rc_user_text | varchar(255) | NO | MUL | NULL | | | rc_namespace | int(11) | NO | MUL | 0 | | | rc_title | varchar(255) | NO | | NULL | | | rc_comment | varchar(255) | NO | | NULL | | | rc_minor | tinyint(3) unsigned | NO | | 0 | | | rc_bot | tinyint(3) unsigned | NO | | 0 | | | rc_new | tinyint(3) unsigned | NO | MUL | 0 | | | rc_cur_id | int(10) unsigned | NO | MUL | 0 | | | rc_this_oldid | int(10) unsigned | NO | | 0 | | | rc_last_oldid | int(10) unsigned | NO | | 0 | | | rc_type | tinyint(3) unsigned | NO | | 0 | | | rc_moved_to_ns | tinyint(3) unsigned | NO | | 0 | | | rc_moved_to_title | varchar(255) | NO | | NULL | | | rc_patrolled | tinyint(3) unsigned | NO | | 0 | | | rc_ip | char(15) | NO | MUL | NULL | | | rc_old_len | int(10) | YES | | NULL | | | rc_new_len | int(10) | YES | | NULL | | | rc_deleted | tinyint(1) unsigned | NO | | 0 | | | rc_logid | int(10) unsigned | NO | | 0 | | | rc_log_type | varchar(255) | YES | | NULL | | | rc_params | blob | NO | | NULL | | +-------------------+---------------------+------+-----+---------+----------------+ 25 rows in set (0.24 sec)
模板:MW 1.4 DESCRIBE recentchanges in MediaWiki 1.4 gives the following:
+-------------------+---------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------------+---------------------+------+-----+---------+----------------+ | rc_timestamp | varchar(14) | NO | MUL | | | | rc_cur_time | varchar(14) | NO | | | | | rc_user | int(10) unsigned | NO | | 0 | | | rc_user_text | varchar(255) | NO | | | | | rc_namespace | int(11) | NO | MUL | 0 | | | rc_title | varchar(255) | NO | | | | | rc_comment | varchar(255) | NO | | | | | rc_minor | tinyint(3) unsigned | NO | | 0 | | | rc_bot | tinyint(3) unsigned | NO | | 0 | | | rc_new | tinyint(3) unsigned | NO | MUL | 0 | | | rc_cur_id | int(10) unsigned | NO | MUL | 0 | | | rc_this_oldid | int(10) unsigned | NO | | 0 | | | rc_last_oldid | int(10) unsigned | NO | | 0 | | | rc_type | tinyint(3) unsigned | NO | | 0 | | | rc_moved_to_ns | tinyint(3) unsigned | NO | | 0 | | | rc_moved_to_title | varchar(255) | NO | | | | | rc_patrolled | tinyint(3) unsigned | NO | | 0 | | | rc_ip | char(15) | NO | MUL | | | +-------------------+---------------------+------+-----+---------+----------------+ 18 rows in set
[編輯] Site stats table
+------------------+---------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------------+---------------------+------+-----+---------+-------+ | ss_row_id | int(8) unsigned | | PRI | 0 | | | ss_total_views | bigint(20) unsigned | YES | | 0 | | | ss_total_edits | bigint(20) unsigned | YES | | 0 | | | ss_good_articles | bigint(20) unsigned | YES | | 0 | | +------------------+---------------------+------+-----+---------+-------+
mysql> describe mw_site_stats; +------------------+---------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------------+---------------------+------+-----+---------+-------+ | ss_row_id | int(8) unsigned | NO | PRI | NULL | | | ss_total_views | bigint(20) unsigned | YES | | 0 | | | ss_total_edits | bigint(20) unsigned | YES | | 0 | | | ss_good_articles | bigint(20) unsigned | YES | | 0 | | | ss_total_pages | bigint(20) | YES | | -1 | | | ss_users | bigint(20) | YES | | -1 | | | ss_admins | int(10) | YES | | -1 | | | ss_images | int(10) | YES | | 0 | | +------------------+---------------------+------+-----+---------+-------+
[編輯] Watchlist table
+------------------+---------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------------+---------------------+------+-----+---------+----------------+ | wl_user | int(5) unsigned | | | | | | wl_namespace | tinyint(2) unsigned | | | 0 | | | wl_title | varchar(255) binary | | | '' | | +------------------+---------------------+------+-----+---------+----------------+
+--------------------------+-----------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------------------------+-----------------+------+-----+---------+-------+ | wl_user | int(5) unsigned | NO | PRI | NULL | | | wl_namespace | int(11) | NO | PRI | 0 | | | wl_title | varchar(255) | NO | PRI | NULL | | | wl_notificationtimestamp | varchar(14) | YES | | NULL | | +--------------------------+-----------------+------+-----+---------+-------+
[編輯] User table
- user_real_name:varchar(255);否 (1.5後亦有)
- user_token:varchar(32) (1.5後亦有)
- user_regdate:varchar(14)
- user_regtime:varchar(6)
- user_usetimes:int(11)
- user_edits:bigint(20)
+------------------+---------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------------+---------------------+------+-----+---------+----------------+ | user_id | int(5) unsigned | | PRI | NULL | auto_increment | | user_name | varchar(255) binary | | | | | | user_rights | tinyblob | | | | | | user_password | tinyblob | | | | | | user_newpassword | tinyblob | | | | | | user_email | tinytext | | | | | | user_options | blob | | | | | | user_touched | varchar(14) binary | | | | | +------------------+---------------------+------+-----+---------+----------------+
+--------------------------+-----------------+------+-----+-------------------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------------------+-----------------+------+-----+-------------------+----------------+ | user_id | int(5) unsigned | NO | PRI | NULL | auto_increment | | user_name | varchar(255) | NO | UNI | NULL | | | user_real_name | varchar(255) | NO | | NULL | | | user_password | tinyblob | NO | | NULL | | | user_newpassword | tinyblob | NO | | NULL | | | user_email | tinytext | NO | | NULL | | | user_options | blob | NO | | NULL | | | user_touched | char(14) | NO | | NULL | | | user_token | char(32) | NO | | NULL | | | user_email_authenticated | char(14) | YES | | NULL | | | user_email_token | char(32) | YES | MUL | NULL | | | user_email_token_expires | char(14) | YES | | NULL | | | user_registration | char(14) | YES | | NULL | | | user_newpass_time | timestamp | YES | | CURRENT_TIMESTAMP | | | user_editcount | int(11) | YES | | NULL | | +--------------------------+-----------------+------+-----+-------------------+----------------+