r98345 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98344‎ | r98345 | r98346 >
Date:18:34, 28 September 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Fix schema creation

Creating sourcetracking table...A database query syntax error has occurred.
The last attempted database query was:
"CREATE TABLE IF NOT EXISTS `mw_sourcetracking` (
`trackingid` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`userid` int(10) NOT NULL,
`source_action` varbinary(255) DEFAULT NULL,
`source_ns` int(11) NOT NULL,
`source_article` int(10) NOT NULL,
PRIMARY KEY (`trackingid`)
)ENGINE=InnoDB, DEFAULT CHARSET=binary
"
from within function "DatabaseBase::sourceFile( /home/reedy/mediawiki/trunk/extensions/SignupAPI/sourcetracking.sql )".
Database returned error "1068: Multiple primary key defined"
Modified paths:
  • /trunk/extensions/SignupAPI/sourcetracking.sql (modified) (history)

Diff [purge]

Index: trunk/extensions/SignupAPI/sourcetracking.sql
@@ -1,8 +1,7 @@
2 -CREATE TABLE IF NOT EXISTS /*_*/sourcetracking (
 2+CREATE TABLE /*_*/sourcetracking (
33 `trackingid` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
44 `userid` int(10) NOT NULL,
55 `source_action` varbinary(255) DEFAULT NULL,
66 `source_ns` int(11) NOT NULL,
77 `source_article` int(10) NOT NULL,
8 - PRIMARY KEY (`trackingid`)
98 )/*$wgDBTableOptions*/;

Follow-up revisions

RevisionCommit summaryAuthorDate
r98346Followup r98345...reedy18:36, 28 September 2011

Comments

#Comment by MaxSem (talk | contribs)   18:37, 28 September 2011

Eh, can this table be brought up to our standards before it's too late? E.g. st_id instead of trackingid and so on. Also, you left a comma at the end. SQL != PHP :)

#Comment by Reedy (talk | contribs)   18:52, 28 September 2011

Already fixed the comma ;)

I'll ping Akshay about doing it

Status & tagging log