r69808 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69807‎ | r69808 | r69809 >
Date:18:43, 23 July 2010
Author:nimishg
Status:reverted (Comments)
Tags:
Comment:
added SQL to create prefswitch table if not exists
Modified paths:
  • /trunk/extensions/SimpleSurvey/SimpleSurvey.patch-pssuser.sql (modified) (history)

Diff [purge]

Index: trunk/extensions/SimpleSurvey/SimpleSurvey.patch-pssuser.sql
@@ -1,5 +1,29 @@
22 --
 3+-- Schema patch for prefswitch_user to make it a varbinary, creates prefswitch table if it doesn't exist
34 --
45
 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+
530 ALTER TABLE /*_*/prefswitch_survey modify pss_user varbinary(255);
\ No newline at end of file

Comments

#Comment by Catrope (talk | contribs)   16:28, 3 August 2010

This illustrates why, per r69807 CR, one extension should not try modifying another extension's tables like this.

#Comment by Catrope (talk | contribs)   16:29, 3 August 2010

Was cleaned up in r69809.

Status & tagging log