Merge "Adding interfaces for ORM row and table classes so these can be used for type...
[lhc/web/wiklou.git] / maintenance / archives / patch-ipb_anon_only.sql
index 606e575..fcd257c 100644 (file)
 DROP TABLE IF EXISTS /*$wgDBprefix*/ipblocks_newunique;
 
 CREATE TABLE /*$wgDBprefix*/ipblocks_newunique (
-  ipb_id int(8) NOT NULL auto_increment,
-  ipb_address tinyblob NOT NULL default '',
-  ipb_user int(8) unsigned NOT NULL default '0',
-  ipb_by int(8) unsigned NOT NULL default '0',
-  ipb_reason tinyblob NOT NULL default '',
-  ipb_timestamp char(14) binary NOT NULL default '',
-  ipb_auto boolean NOT NULL default 0,
-  ipb_anon_only boolean NOT NULL default 0,
-  ipb_create_account boolean NOT NULL default 1,
-  ipb_expiry char(14) binary NOT NULL default '',
-  ipb_range_start tinyblob NOT NULL default '',
-  ipb_range_end tinyblob NOT NULL default '',
+  ipb_id int NOT NULL auto_increment,
+  ipb_address tinyblob NOT NULL,
+  ipb_user int unsigned NOT NULL default '0',
+  ipb_by int unsigned NOT NULL default '0',
+  ipb_reason tinyblob NOT NULL,
+  ipb_timestamp binary(14) NOT NULL default '',
+  ipb_auto bool NOT NULL default 0,
+  ipb_anon_only bool NOT NULL default 0,
+  ipb_create_account bool NOT NULL default 1,
+  ipb_expiry varbinary(14) NOT NULL default '',
+  ipb_range_start tinyblob NOT NULL,
+  ipb_range_end tinyblob NOT NULL,
   
   PRIMARY KEY ipb_id (ipb_id),
   UNIQUE INDEX ipb_address_unique (ipb_address(255), ipb_user, ipb_auto),
@@ -30,7 +30,7 @@ CREATE TABLE /*$wgDBprefix*/ipblocks_newunique (
   INDEX ipb_timestamp (ipb_timestamp),
   INDEX ipb_expiry (ipb_expiry)
 
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 INSERT IGNORE INTO /*$wgDBprefix*/ipblocks_newunique 
         (ipb_id, ipb_address, ipb_user, ipb_by, ipb_reason, ipb_timestamp, ipb_auto, ipb_expiry, ipb_range_start, ipb_range_end, ipb_anon_only, ipb_create_account) 
@@ -41,3 +41,4 @@ DROP TABLE IF EXISTS /*$wgDBprefix*/ipblocks_old;
 RENAME TABLE /*$wgDBprefix*/ipblocks TO /*$wgDBprefix*/ipblocks_old;
 RENAME TABLE /*$wgDBprefix*/ipblocks_newunique TO /*$wgDBprefix*/ipblocks;
 
+UPDATE /*$wgDBprefix*/ipblocks SET ipb_expiry='infinity' WHERE ipb_expiry='';