r109055 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109054‎ | r109055 | r109056 >
Date:19:45, 16 January 2012
Author:kaldari
Status:resolved (Comments)
Tags:
Comment:
follow-up to r109023 - sqlite support, and removing unnecessary MediaWiki check
Modified paths:
  • /trunk/extensions/CongressLookup/SpecialCongressLookup.php (modified) (history)
  • /trunk/extensions/CongressLookup/patches/CongressLookup.sql (modified) (history)

Diff [purge]

Index: trunk/extensions/CongressLookup/SpecialCongressLookup.php
@@ -1,9 +1,4 @@
22 <?php
3 -if ( !defined( 'MEDIAWIKI' ) ) {
4 - echo "CongressLookup extension\n";
5 - exit( 1 );
6 -}
7 -
83 /**
94 * This class creates a page which asks the user for their zip code. It then uses the zip code to
105 * look up information about the user's congressional representatives and presents that information
Index: trunk/extensions/CongressLookup/patches/CongressLookup.sql
@@ -1,5 +1,5 @@
22 CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/cl_senate (
3 - `ss_id` int(10) unsigned NOT NULL,
 3+ `ss_id` int(10) unsigned NOT NULL PRIMARY KEY,
44 `ss_bioguideid` varchar(32) NOT NULL,
55 `ss_gender` varchar(1) NOT NULL,
66 `ss_name` varchar(255) NOT NULL,
@@ -7,13 +7,12 @@
88 `ss_state` varchar(2) NOT NULL,
99 `ss_phone` varchar(32) NOT NULL,
1010 `ss_fax` varchar(32) NOT NULL,
11 - `ss_contactform` varchar(255) NOT NULL,
12 -PRIMARY KEY (`ss_id`)
 11+ `ss_contactform` varchar(255) NOT NULL
1312 ) /*$wgDBTableOptions*/;
1413 CREATE INDEX /*i*/ss_state ON /*$wgDBprefix*/sopa_senate (ss_state);
1514
1615 CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/cl_house (
17 - `sh_id` int(10) unsigned NOT NULL,
 16+ `sh_id` int(10) unsigned NOT NULL PRIMARY KEY,
1817 `sh_bioguideid` varchar(32) NOT NULL,
1918 `sh_gender` varchar(1) NOT NULL,
2019 `sh_name` varchar(255) NOT NULL,
@@ -22,18 +21,15 @@
2322 `sh_district` varchar(32) NOT NULL,
2423 `sh_phone` varchar(32) NOT NULL,
2524 `sh_fax` varchar(32) NOT NULL,
26 - `sh_contactform` varchar(255) NOT NULL,
27 - PRIMARY KEY (`sh_id`)
 25+ `sh_contactform` varchar(255) NOT NULL
2826 ) /*$wgDBTableOptions*/;
2927
3028 CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/cl_zip3 (
31 - `sz3_zip` int(3) unsigned DEFAULT NULL,
32 - `sz3_state` varchar(2) DEFAULT NULL,
33 - PRIMARY KEY (`sz3_zip`)
 29+ `sz3_zip` int(3) unsigned DEFAULT NULL PRIMARY KEY,
 30+ `sz3_state` varchar(2) DEFAULT NULL
3431 ) /*$wgDBTableOptions*/;
3532
3633 CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/cl_zip5 (
37 - `sz5_zip` int(5) unsigned NOT NULL,
38 - `sz5_rep_id` int(10) unsigned DEFAULT NULL,
39 - PRIMARY KEY (`sz5_zip`)
 34+ `sz5_zip` int(5) unsigned NOT NULL PRIMARY KEY,
 35+ `sz5_rep_id` int(10) unsigned DEFAULT NULL
4036 ) /*$wgDBTableOptions*/;

Follow-up revisions

RevisionCommit summaryAuthorDate
r109068followup r109023, r109055...khorn22:24, 16 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r109023initial skelton for CongressLookup extensionkaldari10:12, 16 January 2012

Comments

#Comment by Khorn (WMF) (talk | contribs)   22:22, 16 January 2012

error (can't have a null primary key), on:

`sz3_zip` int(3) unsigned DEFAULT NULL PRIMARY KEY,
Database returned error "1067: Invalid default value for 'sz3_zip' (localhost)"
#Comment by Khorn (WMF) (talk | contribs)   22:31, 16 January 2012

resolved in r109068.

Status & tagging log