r59349 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59348‎ | r59349 | r59350 >
Date:10:13, 23 November 2009
Author:btongminh
Status:ok
Tags:
Comment:
Schema change: add page_namespace_id to table definition
Modified paths:
  • /trunk/extensions/GlobalUsage/GlobalUsage.pg.sql (modified) (history)
  • /trunk/extensions/GlobalUsage/GlobalUsage.sql (modified) (history)
  • /trunk/extensions/GlobalUsage/GlobalUsage_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GlobalUsage/GlobalUsage.sql
@@ -4,6 +4,7 @@
55 -- page_id on the local wiki
66 gil_page int unsigned not null,
77 -- Namespace, since the foreign namespaces may not match the local ones
 8+ gil_page_namespace_id int not null,
89 gil_page_namespace varchar(255) not null,
910 -- Page title
1011 gil_page_title varchar(255) binary not null,
Index: trunk/extensions/GlobalUsage/GlobalUsage.pg.sql
@@ -1,6 +1,7 @@
22 CREATE TABLE globalimagelinks (
33 gil_wiki TEXT NOT NULL,
44 gil_page INTEGER NOT NULL,
 5+ gil_page_namespace_id INTEGER NOT NULL,
56 gil_page_namespace TEXT NOT NULL,
67 gil_page_title TEXT NOT NULL,
78 gil_to TEXT NOT NULL,
Index: trunk/extensions/GlobalUsage/GlobalUsage_body.php
@@ -27,6 +27,7 @@
2828 $insert[] = array(
2929 'gil_wiki' => $this->interwiki,
3030 'gil_page' => $title->getArticleID( $pageIdFlags ),
 31+ 'gil_page_namespace_id' => $title->getNamespace(),
3132 'gil_page_namespace' => $title->getNsText(),
3233 'gil_page_title' => $title->getDBkey(),
3334 'gil_to' => $name
@@ -105,6 +106,7 @@
106107 $insert[] = array(
107108 'gil_wiki' => $this->interwiki,
108109 'gil_page' => $row->page_id,
 110+ 'gil_page_namespace_id' => $row->page_namespace,
109111 'gil_page_namespace' => $wgContLang->getNsText( $row->page_namespace ),
110112 'gil_page_title' => $row->page_title,
111113 'gil_to' => $row->il_to,
@@ -123,6 +125,7 @@
124126 $this->db->update(
125127 'globalimagelinks',
126128 array(
 129+ 'gil_page_namespace_id' => $title->getNamespace(),
127130 'gil_page_namespace' => $title->getNsText(),
128131 'gil_page_title' => $title->getText()
129132 ),

Status & tagging log