r68666 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68665‎ | r68666 | r68667 >
Date:17:01, 28 June 2010
Author:kaldari
Status:resolved (Comments)
Tags:
Comment:
updating mySQL set-up script for multi-language support (bug 20229), deleting postgreSQL set-up script since it is now outdated
Modified paths:
  • /trunk/extensions/CentralNotice/CentralNotice.sql (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/CentralNotice.sql
@@ -24,3 +24,11 @@
2525 `tmp_name` varchar(255) default NULL,
2626 PRIMARY KEY (`tmp_id`)
2727 ) /*$wgDBTableOptions*/;
 28+
 29+CREATE TABLE `cn_notice_languages` (
 30+ `id` int unsigned NOT NULL auto_increment,
 31+ `not_id` int unsigned NOT NULL,
 32+ `not_language` varchar(32) NOT NULL,
 33+ PRIMARY KEY (`id`),
 34+ UNIQUE KEY `not_id_not_language` (`not_id`,`not_language`)
 35+) /*$wgDBTableOptions*/;
\ No newline at end of file

Follow-up revisions

RevisionCommit summaryAuthorDate
r71382fixing table field names per r68666, fixing inserts and deletes per r68580, r...kaldari22:34, 20 August 2010
r71499axing nl_id field for languages table per r71382 and r68666kaldari19:03, 23 August 2010
r76347work towards bug 20229kaldari23:02, 8 November 2010
r76351more work towards multi-project selection - bug 20229kaldari23:29, 8 November 2010
r76356more work towards multi-project selection - bug 20229kaldari23:57, 8 November 2010
r76358more work towards multi-project selection - bug 20229kaldari00:08, 9 November 2010
r76361finishing work towards multi-project selection - bug 20229kaldari00:39, 9 November 2010

Comments

#Comment by MaxSem (talk | contribs)   17:27, 28 June 2010

"deleting postgreSQL set-up script since it is now outdated" is not present in the commit.

#Comment by Kaldari (talk | contribs)   18:09, 28 June 2010

Oops forgot to run the svn delete. Deleted in r68671.

#Comment by Tim Starling (talk | contribs)   08:52, 20 August 2010

Field names are meant to be prefixed with a string that identifies the table, so that you don't have to use table selectors in queries. Here, not_ is already used by the cn_notices table, which presumably will be in the same query. So you need to change the prefix, say to nl_.

What is the id field for, and why is it unprefixed? If not_id is a link to cn_notices.not_id, then it should be called something descriptive like nl_notice or nl_notice_id.

For most things I wouldn't be so picky, but for schema changes, you have to get them right the first time, because it's hard to change them after they're applied.

#Comment by Kaldari (talk | contribs)   20:31, 20 August 2010

Ah that makes sense (and also explains why Pager::extractResultInfo() couldn't handle table prefixes (see r71059)). I was basically just using the same field naming conventions as the other CentralNotice bridge table, cn_assignments, which unfortunately also duplicates field names from other tables. I don't imagine there's any way to fix that one now, but I'll fix this one.

#Comment by Kaldari (talk | contribs)   22:37, 20 August 2010

fixed in r71382.

Status & tagging log