Christian Boltz 856cd0
/*
Christian Boltz 856cd0
 * migrate hit counter data to the separate table used by the HitCounters extension
Christian Boltz 856cd0
 *
Christian Boltz 856cd0
 * run this BEFORE running maintenance/update.php, or counter data will be lost!
Christian Boltz 856cd0
 *
Christian Boltz 856cd0
 * Source: https://www.mediawiki.org/wiki/Extension_talk:HitCounters#Manual_generation_of_DB_tables_during_upgrade
Christian Boltz 856cd0
 */
Christian Boltz 856cd0
Christian Boltz 856cd0
RENAME TABLE hitcounter TO hit_counter_extension;
Christian Boltz 856cd0
CREATE TABLE hit_counter (
Christian Boltz 856cd0
  page_id INT(8) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
Christian Boltz 856cd0
  page_counter BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'
Christian Boltz 856cd0
) ;
Christian Boltz 856cd0
CREATE INDEX page_counter ON hit_counter (page_counter);
Christian Boltz 856cd0
INSERT INTO hit_counter (page_id, page_counter) SELECT page.page_id, page.page_counter FROM page;