http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88856
Revision: 88856
Author: yuvipanda
Date: 2011-05-25 22:48:00 +0000 (Wed, 25 May 2011)
Log Message:
-----------
Ignore previously populated articles
Modified Paths:
--------------
trunk/extensions/ShortUrl/populateShortUrlTable.php
trunk/extensions/ShortUrl/schemas/shorturls.sql
Modified: trunk/extensions/ShortUrl/populateShortUrlTable.php
===================================================================
--- trunk/extensions/ShortUrl/populateShortUrlTable.php 2011-05-25 22:46:13 UTC
(rev 88855)
+++ trunk/extensions/ShortUrl/populateShortUrlTable.php 2011-05-25 22:48:00 UTC
(rev 88856)
@@ -17,7 +17,8 @@
$dbw->insert(
'shorturls',
$a,
- __METHOD__
+ __METHOD__,
+ array( 'IGNORE' )
);
}
Modified: trunk/extensions/ShortUrl/schemas/shorturls.sql
===================================================================
--- trunk/extensions/ShortUrl/schemas/shorturls.sql 2011-05-25 22:46:13 UTC
(rev 88855)
+++ trunk/extensions/ShortUrl/schemas/shorturls.sql 2011-05-25 22:48:00 UTC
(rev 88856)
@@ -2,10 +2,11 @@
-- Replace /*$wgDBTableOptions*/ with the correct options
CREATE TABLE IF NOT EXISTS /*_*/shorturls (
- su_id integer NOT NULL AUTO_INCREMENT,
- su_namespace integer NOT NULL,
- su_title varchar(255) NOT NULL,
- PRIMARY KEY (su_id)
+ su_id integer NOT NULL AUTO_INCREMENT,
+ su_namespace integer NOT NULL,
+ su_title varchar(255) NOT NULL,
+ PRIMARY KEY (su_id),
+ UNIQUE KEY (su_namespace, su_title)
) /*$wgDBTableOptions*/;
CREATE INDEX /*i*/su_id ON /*_*/shorturls (su_id);
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs