Jump to content

Manual:Database layout/diagram/1.36.0

From mediawiki.org

Full screen

Database schema of MediaWiki 1.36.0 (May 2021).
Refer to https://www.mediawiki.org/wiki/DB for more details.

User

  • user_id INT
  • user_name VARBINARY(255)
  • user_real_name VARBINARY(255)
  • user_password TINYBLOB
  • user_newpassword TINYBLOB
  • user_newpass_time BINARY(14)
  • user_email TINYTEXT
  • user_touched BINARY(14)
  • user_token BINARY(32)
  • user_email_authenticated BINARY(14)
  • user_email_token BINARY(32)
  • user_email_token_expires BINARY(14)
  • user_registration BINARY(14)
  • user_editcount INT
  • user_password_expires VARBINARY(14)
  • up_user INT
  • up_property VARBINARY(255)
  • up_value BLOB
  • user_id INT
  • user_ip VARBINARY(40)
  • user_last_timestamp BINARY(14)
  • actor_id BIGINT
  • actor_user INT
  • actor_name VARBINARY(255)
  • bp_user INT
  • bp_app_id VARBINARY(32)
  • bp_password TINYBLOB
  • bp_token BINARY(32)
  • bp_restrictions BLOB
  • bp_grants BLOB

Permissions

  • ug_user INT
  • ug_group VARBINARY(255)
  • ug_expiry VARBINARY(14)
  • ufg_user INT
  • ufg_group VARBINARY(255)
  • pr_id INT
  • pr_page INT
  • pr_type VARBINARY(60)
  • pr_level VARBINARY(60)
  • pr_cascade TINYINT
  • pr_user INT
  • pr_expiry VARBINARY(14)
  • pt_namespace INT
  • pt_title VARBINARY(255)
  • pt_user INT
  • pt_reason_id BIGINT
  • pt_timestamp BINARY(14)
  • pt_expiry VARBINARY(14)
  • pt_create_perm VARBINARY(60)
  • ipb_id INT
  • ipb_address TINYBLOB
  • ipb_user INT
  • ipb_by_actor BIGINT
  • ipb_reason_id BIGINT
  • ipb_timestamp BINARY(14)
  • ipb_auto TINYINT(1)
  • ipb_anon_only TINYINT(1)
  • ipb_create_account TINYINT(1)
  • ipb_enable_autoblock TINYINT(1)
  • ipb_expiry VARBINARY(14)
  • ipb_range_start TINYBLOB
  • ipb_range_end TINYBLOB
  • ipb_deleted TINYINT(1)
  • ipb_block_email TINYINT(1)
  • ipb_allow_usertalk TINYINT(1)
  • ipb_parent_block_id INT
  • ipb_sitewide TINYINT(1)
  • ir_ipb_id INT
  • ir_type TINYINT(4)
  • ir_value INT

Logging

  • log_id INT
  • log_type VARBINARY(32)
  • log_action VARBINARY(32)
  • log_timestamp BINARY(14)
  • log_actor BIGINT
  • log_namespace INT
  • log_title VARBINARY(255)
  • log_page INT
  • log_comment_id BIGINT
  • log_params BLOB
  • log_deleted TINYINT
  • ls_field VARBINARY(32)
  • ls_value VARCHAR(255)
  • ls_log_id INT
  • comment_id BIGINT
  • comment_hash INT
  • comment_text BLOB
  • comment_data BLOB

Tags

  • ct_id INT
  • ct_rc_id INT
  • ct_log_id INT
  • ct_rev_id INT
  • ct_params BLOB
  • ct_tag_id INT
  • ctd_id INT
  • ctd_name VARBINARY(255)
  • ctd_user_defined TINYINT(1)
  • ctd_count BIGINT

Recent changes

  • rc_id INT
  • rc_timestamp BINARY(14)
  • rc_actor BIGINT
  • rc_namespace INT
  • rc_title VARBINARY(255)
  • rc_comment_id BIGINT
  • rc_minor TINYINT
  • rc_bot TINYINT
  • rc_new TINYINT
  • rc_cur_id INT
  • rc_this_oldid INT
  • rc_last_oldid INT
  • rc_type TINYINT
  • rc_source VARBINARY(16)
  • rc_patrolled TINYINT
  • rc_ip VARBINARY(40)
  • rc_old_len INT
  • rc_new_len INT
  • rc_deleted TINYINT
  • rc_logid INT
  • rc_log_type VARBINARY(255)
  • rc_log_action VARBINARY(255)
  • rc_params BLOB
  • wl_id INT
  • wl_user INT
  • wl_namespace INT
  • wl_title VARBINARY(255)
  • wl_notificationtimestamp BINARY(14)
  • we_item INT
  • we_expiry BINARY(14)

Pages

  • page_id INT
  • page_namespace INT
  • page_title VARBINARY(255)
  • page_restrictions TINYBLOB
  • page_is_redirect TINYINT
  • page_is_new TINYINT
  • page_random DOUBLE
  • page_touched BINARY(14)
  • page_links_updated VARBINARY(14)
  • page_latest INT
  • page_len INT
  • page_content_model VARBINARY(32)
  • page_lang VARBINARY(35)
  • pp_page INT
  • pp_propname VARBINARY(60)
  • pp_value BLOB
  • pp_sortkey FLOAT
  • ar_id INT
  • ar_namespace INT
  • ar_title VARBINARY(255)
  • ar_comment_id BIGINT
  • ar_actor BIGINT
  • ar_timestamp BINARY(14)
  • ar_minor_edit TINYINT
  • ar_rev_id INT
  • ar_deleted TINYINT
  • ar_len INT
  • ar_page_id INT
  • ar_parent_id INT
  • ar_sha1 VARBINARY(32)
  • rd_from INT
  • rd_namespace INT
  • rd_title VARBINARY(255)
  • rd_interwiki VARCHAR(32)
  • rd_fragment VARBINARY(255)
  • cat_id INT
  • cat_title VARBINARY(255)
  • cat_pages INT
  • cat_subcats INT
  • cat_files INT

Revisions

  • rev_id INT
  • rev_page INT
  • rev_comment_id BIGINT
  • rev_actor BIGINT
  • rev_timestamp BINARY(14)
  • rev_minor_edit TINYINT
  • rev_deleted TINYINT
  • rev_len INT
  • rev_parent_id INT
  • rev_sha1 VARBINARY(32)
  • revcomment_rev INT
  • revcomment_comment_id BIGINT
  • revactor_rev INT
  • revactor_actor BIGINT
  • revactor_timestamp BINARY(14)
  • revactor_page INT
  • slot_revision_id BIGINT
  • slot_role_id SMALLINT
  • slot_content_id BIGINT
  • slot_origin BIGINT
  • role_id INT
  • role_name VARBINARY(64)
  • ipc_rev_id INT
  • ipc_rev_timestamp BINARY(14)
  • ipc_hex VARBINARY(35)
  • content_id BIGINT
  • content_size INT
  • content_sha1 VARBINARY(32)
  • content_model SMALLINT
  • content_address VARBINARY(255)
  • model_id INT
  • model_name VARBINARY(64)
  • old_id INT
  • old_text MEDIUMBLOB
  • old_flags TINYBLOB
  • pl_from INT
  • pl_namespace INT
  • pl_title VARBINARY(255)
  • pl_from_namespace INT
  • iwl_from INT
  • iwl_prefix VARBINARY(32)
  • iwl_title VARBINARY(255)
  • el_id INT
  • el_from INT
  • el_to BLOB
  • el_index BLOB
  • el_index_60 VARBINARY(60)
  • ll_from INT
  • ll_lang VARBINARY(35)
  • ll_title VARBINARY(255)
  • il_from INT
  • il_to VARBINARY(255)
  • il_from_namespace INT
  • tl_from INT
  • tl_namespace INT
  • tl_title VARBINARY(255)
  • tl_from_namespace INT
  • cl_from INT
  • cl_to VARBINARY(255)
  • cl_sortkey VARBINARY(230)
  • cl_sortkey_prefix VARBINARY(255)
  • cl_timestamp TIMESTAMP
  • cl_collation VARBINARY(32)
  • cl_type ENUM(…)

Statistics

  • ss_row_id INT
  • ss_total_edits BIGINT
  • ss_good_articles BIGINT
  • ss_total_pages BIGINT
  • ss_users BIGINT
  • ss_active_users BIGINT
  • ss_images BIGINT
  • si_page INT
  • si_title VARCHAR(255)
  • si_text MEDIUMTEXT

Maintenance

  • job_id INT
  • job_cmd VARBINARY(60)
  • job_namespace INT
  • job_title VARBINARY(255)
  • job_timestamp BINARY(14)
  • job_params MEDIUMBLOB
  • job_random INT
  • job_attempts INT
  • job_token VARBINARY(32)
  • job_token_timestamp BINARY(14)
  • job_sha1 VARBINARY(32)
  • ul_key VARCHAR(255)
  • ul_value BLOB

Multimedia

  • img_name VARBINARY(255)
  • img_size INT
  • img_width INT
  • img_height INT
  • img_metadata MEDIUMBLOB
  • img_bits INT
  • img_media_type ENUM(…)
  • img_major_mime ENUM(…)
  • img_minor_mime VARBINARY(100)
  • img_description_id BIGINT
  • img_actor BIGINT
  • img_timestamp BINARY(14)
  • img_sha1 VARBINARY(32)
  • oi_name VARBINARY(255)
  • oi_archive_name VARBINARY(255)
  • oi_size INT
  • oi_width INT
  • oi_height INT
  • oi_bits INT
  • oi_description_id BIGINT
  • oi_actor BIGINT
  • oi_timestamp BINARY(14)
  • oi_metadata MEDIUMBLOB
  • oi_media_type ENUM(…)
  • oi_major_mime ENUM(…)
  • oi_minor_mime VARBINARY(100)
  • oi_deleted TINYINT
  • oi_sha1 VARBINARY(32)
  • fa_id INT
  • fa_name VARBINARY(255)
  • fa_archive_name VARBINARY(255)
  • fa_storage_group VARBINARY(16)
  • fa_storage_key VARBINARY(64)
  • fa_deleted_user INT
  • fa_deleted_timestamp BINARY(14)
  • fa_deleted_reason_id BIGINT
  • fa_size INT
  • fa_width INT
  • fa_height INT
  • fa_metadata MEDIUMBLOB
  • fa_bits INT
  • fa_media_type ENUM(…)
  • fa_major_mime ENUM(…)
  • fa_minor_mime VARBINARY(100)
  • fa_description_id BIGINT
  • fa_actor BIGINT
  • fa_timestamp BINARY(14)
  • fa_deleted TINYINT
  • fa_sha1 VARBINARY(32)
  • us_id INT
  • us_user INT
  • us_key VARCHAR(255)
  • us_orig_path VARCHAR(255)
  • us_path VARCHAR(255)
  • us_source_type VARCHAR(50)
  • us_timestamp BINARY(14)
  • us_status VARCHAR(50)
  • us_chunk_inx INT
  • us_props BLOB
  • us_size INT
  • us_sha1 VARCHAR(31)
  • us_mime VARCHAR(255)
  • us_media_type ENUM(…)
  • us_image_width INT
  • us_image_height INT
  • us_image_bits SMALLINT

Interwiki

  • site_id INT
  • site_global_key VARBINARY(64)
  • site_type VARBINARY(32)
  • site_group VARBINARY(32)
  • site_source VARBINARY(32)
  • site_language VARBINARY(35)
  • site_protocol VARBINARY(32)
  • site_domain VARCHAR(255)
  • site_data BLOB
  • site_forward TINYINT(1)
  • site_config BLOB
  • si_type VARBINARY(32)
  • si_key VARBINARY(32)
  • si_site INT
  • iw_prefix VARCHAR(32)
  • iw_url BLOB
  • iw_api BLOB
  • iw_wikiid VARCHAR(64)
  • iw_local TINYINT(1)
  • iw_trans TINYINT

Caching tables

  • qc_type VARBINARY(32)
  • qc_value INT
  • qc_namespace INT
  • qc_title VARBINARY(255)
  • keyname VARBINARY(255)
  • value MEDIUMBLOB
  • exptime BINARY(14)
  • qcc_type VARBINARY(32)
  • qcc_value INT
  • qcc_namespace INT
  • qcc_title VARBINARY(255)
  • qcc_namespacetwo INT
  • qcc_titletwo VARBINARY(255)
  • qci_type VARBINARY(32)
  • qci_timestamp BINARY(14)
  • lc_lang VARBINARY(35)
  • lc_key VARCHAR(255)
  • lc_value MEDIUMBLOB

ResourceLoader

  • md_module VARBINARY(255)
  • md_skin VARBINARY(32)
  • md_deps MEDIUMBLOB

Credit: Nick Jenkins, Timo Tijhof / CC BY-SA 3.0

From https://www.mediawiki.org/wiki/Manual:Database_layout/diagram/1.36.0