Skip to content

Instantly share code, notes, and snippets.

@kovid-r
Created October 30, 2021 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kovid-r/a03ef500271f9b2b6d796ba98b236036 to your computer and use it in GitHub Desktop.
Save kovid-r/a03ef500271f9b2b6d796ba98b236036 to your computer and use it in GitHub Desktop.
MediaWiki Schema for Hive
CREATE TABLE IF NOT EXISTS `archive` (
`ar_namespace` int,
`ar_title` binary,
`ar_string` binary,
`ar_comment` binary,
`ar_user` int,
`ar_user_string` binary,
`ar_timestamp` binary,
`ar_minor_edit` tinyint,
`ar_flags` binary,
`ar_rev_id` int,
`ar_string_id` int,
`ar_deleted` tinyint,
`ar_len` int,
`ar_page_id` int,
`ar_parent_id` int
);
CREATE TABLE IF NOT EXISTS `category` (
`cat_id` int,
`cat_title` binary,
`cat_pages` int,
`cat_subcats` int,
`cat_files` int,
`cat_hidden` tinyint
);
CREATE TABLE IF NOT EXISTS `categorylinks` (
`cl_from` int,
`cl_to` binary,
`cl_sortkey` binary,
`cl_timestamp` timestamp
);
CREATE TABLE IF NOT EXISTS `change_tag` (
`ct_rc_id` int,
`ct_log_id` int,
`ct_rev_id` int,
`ct_tag` binary
);
CREATE TABLE IF NOT EXISTS `externallinks` (
`el_from` int,
`el_to` binary,
`el_index` binary
);
CREATE TABLE IF NOT EXISTS `filearchive` (
`fa_id` int,
`fa_name` binary,
`fa_archive_name` binary,
`fa_storage_group` binary,
`fa_storage_key` binary,
`fa_deleted_user` int,
`fa_deleted_timestamp` binary,
`fa_deleted_reason` binary,
`fa_size` int,
`fa_width` int,
`fa_height` int,
`fa_metadata` binary,
`fa_bits` int,
`fa_media_type` string,
`fa_major_mime` string,
`fa_minor_mime` binary,
`fa_description` binary,
`fa_user` int,
`fa_user_string` binary,
`fa_timestamp` binary,
`fa_deleted` tinyint
);
CREATE TABLE IF NOT EXISTS `hitcounter` (
`hc_id` int
);
CREATE TABLE IF NOT EXISTS `image` (
`img_name` binary,
`img_size` int,
`img_width` int,
`img_height` int,
`img_metadata` binary,
`img_bits` int,
`img_media_type` string,
`img_major_mime` string,
`img_minor_mime` binary,
`img_description` binary,
`img_user` int,
`img_user_string` binary,
`img_timestamp` binary,
`img_sha1` binary
);
CREATE TABLE IF NOT EXISTS `imagelinks` (
`il_from` int,
`il_to` binary
);
CREATE TABLE IF NOT EXISTS `interwiki` (
`iw_prefix` binary,
`iw_url` binary,
`iw_local` tinyint,
`iw_trans` tinyint
);
CREATE TABLE IF NOT EXISTS `ipblocks` (
`ipb_id` int,
`ipb_address` binary,
`ipb_user` int,
`ipb_by` int,
`ipb_by_string` binary,
`ipb_reason` binary,
`ipb_timestamp` binary,
`ipb_auto` tinyint,
`ipb_anon_only` tinyint,
`ipb_create_account` tinyint,
`ipb_enable_autoblock` tinyint,
`ipb_expiry` binary,
`ipb_range_start` binary,
`ipb_range_end` binary,
`ipb_deleted` tinyint,
`ipb_block_email` tinyint,
`ipb_allow_usertalk` tinyint
);
CREATE TABLE IF NOT EXISTS `job` (
`job_id` int,
`job_cmd` binary,
`job_namespace` int,
`job_title` binary,
`job_params` binary
)
CREATE TABLE IF NOT EXISTS `langlinks` (
`ll_from` int,
`ll_lang` binary,
`ll_title` binary
);
CREATE TABLE IF NOT EXISTS `logging` (
`log_id` int,
`log_type` binary,
`log_action` binary,
`log_timestamp` binary,
`log_user` int,
`log_namespace` int,
`log_title` binary,
`log_comment` binary,
`log_params` binary,
`log_deleted` tinyint
);
CREATE TABLE IF NOT EXISTS `math` (
`math_inputhash` binary,
`math_outputhash` binary,
`math_html_conservativeness` tinyint,
`math_html` binary,
`math_mathml` binary
);
CREATE TABLE IF NOT EXISTS `objectcache` (
`keyname` binary,
`value` binary,
`exptime` timestamp
);
CREATE TABLE IF NOT EXISTS `oldimage` (
`oi_name` binary,
`oi_archive_name` binary,
`oi_size` int,
`oi_width` int,
`oi_height` int,
`oi_bits` int,
`oi_description` binary,
`oi_user` int,
`oi_user_string` binary,
`oi_timestamp` binary,
`oi_metadata` binary,
`oi_media_type` string,
`oi_major_mime` string,
`oi_minor_mime` binary,
`oi_deleted` tinyint,
`oi_sha1` binary
);
CREATE TABLE IF NOT EXISTS `page` (
`page_id` int,
`page_namespace` int,
`page_title` binary,
`page_restrictions` binary,
`page_counter` bigint,
`page_is_redirect` tinyint,
`page_is_new` tinyint,
`page_random` decimal,
`page_touched` binary,
`page_latest` int,
`page_len` int
);
CREATE TABLE IF NOT EXISTS `page_props` (
`pp_page` int,
`pp_propname` binary,
`pp_value` binary
);
CREATE TABLE IF NOT EXISTS `page_restrictions` (
`pr_page` int,
`pr_type` binary,
`pr_level` binary,
`pr_cascade` tinyint,
`pr_user` int,
`pr_expiry` binary,
`pr_id` int
);
CREATE TABLE IF NOT EXISTS `pagelinks` (
`pl_from` int,
`pl_namespace` int,
`pl_title` binary
);
CREATE TABLE IF NOT EXISTS `protected_titles` (
`pt_namespace` int,
`pt_title` binary,
`pt_user` int,
`pt_reason` binary,
`pt_timestamp` binary,
`pt_expiry` binary,
`pt_create_perm` binary
);
CREATE TABLE IF NOT EXISTS `querycache` (
`qc_type` binary,
`qc_value` int,
`qc_namespace` int,
`qc_title` binary
);
CREATE TABLE IF NOT EXISTS `querycache_info` (
`qci_type` binary,
`qci_timestamp` binary
);
CREATE TABLE IF NOT EXISTS `querycachetwo` (
`qcc_type` binary,
`qcc_value` int,
`qcc_namespace` int,
`qcc_title` binary,
`qcc_namespacetwo` int,
`qcc_titletwo` binary
);
CREATE TABLE IF NOT EXISTS `recentchanges` (
`rc_id` int,
`rc_timestamp` binary,
`rc_cur_time` binary,
`rc_user` int,
`rc_user_string` binary,
`rc_namespace` int,
`rc_title` binary,
`rc_comment` binary,
`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_moved_to_ns` tinyint,
`rc_moved_to_title` binary,
`rc_patrolled` tinyint,
`rc_ip` binary,
`rc_old_len` int,
`rc_new_len` int,
`rc_deleted` tinyint,
`rc_logid` int,
`rc_log_type` binary,
`rc_log_action` binary,
`rc_params` binary
);
CREATE TABLE IF NOT EXISTS `redirect` (
`rd_from` int,
`rd_namespace` int,
`rd_title` binary
);
CREATE TABLE IF NOT EXISTS `revision` (
`rev_id` int,
`rev_page` int,
`rev_string_id` int,
`rev_comment` binary,
`rev_user` int,
`rev_user_string` binary,
`rev_timestamp` binary,
`rev_minor_edit` tinyint,
`rev_deleted` tinyint,
`rev_len` int,
`rev_parent_id` int
);
CREATE TABLE IF NOT EXISTS `searchindex` (
`si_page` int,
`si_title` string,
`si_string` string
);
CREATE TABLE IF NOT EXISTS `site_stats` (
`ss_row_id` int,
`ss_total_views` bigint,
`ss_total_edits` bigint,
`ss_good_articles` bigint,
`ss_total_pages` bigint,
`ss_users` bigint,
`ss_active_users` bigint,
`ss_admins` int,
`ss_images` int
);
CREATE TABLE IF NOT EXISTS `tag_summary` (
`ts_rc_id` int,
`ts_log_id` int,
`ts_rev_id` int,
`ts_tags` binary
);
CREATE TABLE IF NOT EXISTS `templatelinks` (
`tl_from` int,
`tl_namespace` int,
`tl_title` binary
);
CREATE TABLE IF NOT EXISTS `string` (
`old_id` int,
`old_string` binary,
`old_flags` binary
);
CREATE TABLE IF NOT EXISTS `trackbacks` (
`tb_id` int,
`tb_page` int,
`tb_title` binary,
`tb_url` binary,
`tb_ex` binary,
`tb_name` binary
);
CREATE TABLE IF NOT EXISTS `transcache` (
`tc_url` binary,
`tc_contents` binary,
`tc_time` int
);
CREATE TABLE IF NOT EXISTS `updatelog` (
`ul_key` binary
);
CREATE TABLE IF NOT EXISTS `user` (
`user_id` int,
`user_name` binary,
`user_real_name` binary,
`user_password` binary,
`user_newpassword` binary,
`user_newpass_time` binary,
`user_email` binary,
`user_options` binary,
`user_touched` binary,
`user_token` binary,
`user_email_authenticated` binary,
`user_email_token` binary,
`user_email_token_expires` binary,
`user_registration` binary,
`user_editcount` int
);
CREATE TABLE IF NOT EXISTS `user_groups` (
`ug_user` int,
`ug_group` binary
);
CREATE TABLE IF NOT EXISTS `user_newtalk` (
`user_id` int,
`user_ip` binary,
`user_last_timestamp` binary
);
CREATE TABLE IF NOT EXISTS `valid_tag` (
`vt_tag` binary
);
CREATE TABLE IF NOT EXISTS `watchlist` (
`wl_user` int,
`wl_namespace` int,
`wl_title` binary,
`wl_notificationtimestamp` binary
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment