Index: trunk/extensions/SimpleSurvey/SimpleSurvey.patch-pssuser.sql |
— | — | @@ -1,29 +1,5 @@ |
2 | 2 | -- |
| 3 | +-- Schema patch for prefswitch_user to make it a varbinary |
3 | 4 | -- |
4 | 5 | |
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 | | - |
29 | 6 | 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 @@ |
16 | 16 | |
17 | 17 | /* update schema*/ |
18 | 18 | public static function schema( ){ |
19 | | - global $wgExtModifiedFields; |
| 19 | + global $wgExtModifiedFields, $wgExtNewTables; |
20 | 20 | |
| 21 | + $wgExtNewTables[] = array( 'prefswitch_survey', |
| 22 | + dirname( dirname( __FILE__ ) ) ."/UsabilityInitiative/PrefSwitch/PrefSwitch.sql" |
| 23 | + ); |
| 24 | + |
21 | 25 | $wgExtModifiedFields[] = array( |
22 | 26 | 'prefswitch_survey', |
23 | 27 | 'pss_user', |