Index: trunk/extensions/SimpleSurvey/SimpleSurvey.patch-pssuser.sql |
— | — | @@ -1,5 +1,29 @@ |
2 | 2 | -- |
| 3 | +-- Schema patch for prefswitch_user to make it a varbinary, creates prefswitch table if it doesn't exist |
3 | 4 | -- |
4 | 5 | |
| 6 | +CREATE TABLE IF NOT EXISTS /*_*/prefswitch_survey ( |
| 7 | + -- User ID |
| 8 | + pss_user varbinary(255) NOT NULL, |
| 9 | + |
| 10 | + -- Timestamp |
| 11 | + pss_timestamp binary(14) NOT NULL, |
| 12 | + |
| 13 | + -- Survey name (out, feedback, etc.) |
| 14 | + pss_name varchar(16) NOT NULL, |
| 15 | + |
| 16 | + -- Question ID (key in $wgPrefSwitchSurvey) |
| 17 | + pss_question varchar(16) NOT NULL, |
| 18 | + |
| 19 | + -- Answer ID (key in $wgPrefSwitchSurvey[pss_question]['answers']) |
| 20 | + pss_answer text NULL, |
| 21 | + |
| 22 | + -- Optional text associated with the answer |
| 23 | + pss_answer_data text NULL |
| 24 | +) /*$wgDBTableOptions*/; |
| 25 | + |
| 26 | +CREATE UNIQUE INDEX /*i*/pss_user_timestamp_name_question ON /*_*/prefswitch_survey (pss_user, pss_timestamp, pss_name, pss_question); |
| 27 | + |
| 28 | + |
| 29 | + |
5 | 30 | ALTER TABLE /*_*/prefswitch_survey modify pss_user varbinary(255); |
\ No newline at end of file |