r69809 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69808‎ | r69809 | r69810 >
Date:18:49, 23 July 2010
Author:nimishg
Status:ok
Tags:
Comment:
Slightly more sensible way to do this update
Modified paths:
  • /trunk/extensions/SimpleSurvey/SimpleSurvey.classes.php (modified) (history)
  • /trunk/extensions/SimpleSurvey/SimpleSurvey.patch-pssuser.sql (modified) (history)

Diff [purge]

Index: trunk/extensions/SimpleSurvey/SimpleSurvey.patch-pssuser.sql
@@ -1,29 +1,5 @@
22 --
 3+-- Schema patch for prefswitch_user to make it a varbinary
34 --
45
5 -CREATE TABLE IF NOT EXISTS /*_*/prefswitch_survey (
6 - -- User ID
7 - pss_user varbinary(255) NOT NULL,
8 -
9 - -- Timestamp
10 - pss_timestamp binary(14) NOT NULL,
11 -
12 - -- Survey name (out, feedback, etc.)
13 - pss_name varchar(16) NOT NULL,
14 -
15 - -- Question ID (key in $wgPrefSwitchSurvey)
16 - pss_question varchar(16) NOT NULL,
17 -
18 - -- Answer ID (key in $wgPrefSwitchSurvey[pss_question]['answers'])
19 - pss_answer text NULL,
20 -
21 - -- Optional text associated with the answer
22 - pss_answer_data text NULL
23 -) /*$wgDBTableOptions*/;
24 -
25 -CREATE UNIQUE INDEX /*i*/pss_user_timestamp_name_question ON /*_*/prefswitch_survey (pss_user, pss_timestamp, pss_name, pss_question);
26 -
27 -
28 -
296 ALTER TABLE /*_*/prefswitch_survey modify pss_user varbinary(255);
\ No newline at end of file
Index: trunk/extensions/SimpleSurvey/SimpleSurvey.classes.php
@@ -15,8 +15,12 @@
1616
1717 /* update schema*/
1818 public static function schema( ){
19 - global $wgExtModifiedFields;
 19+ global $wgExtModifiedFields, $wgExtNewTables;
2020
 21+ $wgExtNewTables[] = array( 'prefswitch_survey',
 22+ dirname( dirname( __FILE__ ) ) ."/UsabilityInitiative/PrefSwitch/PrefSwitch.sql"
 23+ );
 24+
2125 $wgExtModifiedFields[] = array(
2226 'prefswitch_survey',
2327 'pss_user',

Status & tagging log