ALTER TABLE `users` ADD COLUMN `reply` TINYINT(1) NOT NULL DEFAULT 0 AFTER `growlPassword`,
 ADD COLUMN `newFriends` TINYINT(1) NOT NULL DEFAULT 0 AFTER `reply`,
 ADD COLUMN `recipientDirectMessage` TINYINT(1) NOT NULL DEFAULT 0 AFTER `newFriends`;

DROP TABLE IF EXISTS `docomo_extends`;
CREATE TABLE `docomo_extends` (
  `modelId` bigint(20) NOT NULL AUTO_INCREMENT,
  `model` varchar(100) NOT NULL,
  `htmlVersion` varchar(10) NOT NULL,
  `depth` int(11) NOT NULL DEFAULT '2',
  `width` int(11) NOT NULL DEFAULT '240',
  `height` int(11) NOT NULL DEFAULT '320',
  PRIMARY KEY (`modelId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO docomo_extends(model, depth, width, height) VALUES('D501i', 2, 96, 72),('F501i', 2, 112, 84),('N501i', 2, 118, 128),('P501i', 2, 96, 120),('D502i', 256, 96, 90),('F502i', 256, 96, 91),('N502i', 4, 118, 128),('P502i', 4, 96, 117),('NM502i', 2, 111, 106),('SO502i', 4, 120, 120),('F502it', 256, 96, 91),('N502it', 256, 118, 128),('SO502iWM', 256, 120, 113),('SH821i', 256, 96, 78),('N821i', 4, 118, 128),('P821i', 4, 118, 128),('D209i', 256, 96, 90),('ER209i', 2, 120, 72),('F209i', 256, 96, 91),('KO209i', 256, 96, 96),('N209i', 4, 108, 82),('P209i', 4, 96, 87),('P209iS', 256, 96, 87),('R209i', 4, 96, 72),('P651ps', 4, 96, 87),('R691i', 4, 96, 72),('F671i', 256, 120, 126),('F210i', 256, 96, 113),('N210i', 256, 118, 113),('P210i', 256, 96, 91),('KO210i', 256, 96, 96),('F503i', 256, 120, 130),('F503iS', 4096, 120, 130),('P503i', 256, 120, 130),('P503iS', 256, 120, 130),('N503i', 4096, 118, 128),('N503iS', 4096, 118, 128),('SO503i', 65536, 120, 113),('SO503iS', 65536, 120, 113),('D503i', 4096, 132, 126),('D503iS', 4096, 132, 126),('D210i', 256, 96, 91),('SO210i', 256, 120, 113),('F211i', 4096, 96, 113),('D211i', 4096, 100, 91),('N211i', 4096, 118, 128),('N211iS', 4096, 118, 128),('P211i', 65536, 120, 130),('P211iS', 65536, 120, 130),('SO211i', 4096, 120, 112),('R211i', 4096, 96, 98),('SH251i', 65536, 120, 130),('SH251iS', 65536, 176, 187),('R692i', 4096, 96, 98),('N2001', 4096, 118, 128),('N2002', 65536, 118, 128),('P2002', 65536, 118, 128),('D2101V', 262144, 120, 130),('P2101V', 262144, 163, 182),('SH2101V', 65536, 800, 600),('T2101V', 262144, 176, 144),('D504i', 262144, 132, 144),('F504i', 65536, 132, 136),('F504iS', 65536, 132, 136),('N504i', 65536, 160, 180),('N504iS', 65536, 160, 180),('SO504i', 65536, 120, 112),('P504i', 65536, 132, 144),('P504iS', 65536, 132, 144),('D251i', 262144, 132, 144),('D251iS', 262144, 132, 144),('F251i', 65536, 132, 140),('N251i', 65536, 132, 140),('N251iS', 65536, 132, 140),('P251iS', 65536, 132, 144),('F671iS', 65536, 160, 120),('F212i', 65536, 132, 136),('SO212i', 65536, 120, 112),('F661i', 65536, 132, 136),('F672i', 65536, 160, 120),('SO213i', 65536, 120, 112),('SO213iS', 65536, 120, 112),('SO213iWR', 65536, 120, 112),('F2051', 65536, 176, 182),('N2051', 65536, 176, 198),('P2102V', 262144, 176, 198),('F2102V', 65536, 176, 182),('N2102V', 65536, 176, 198),('N2701', 65536, 176, 198),('NM850iG', 65536, 176, 144),('NM705i', 16777216, 231, 235),('NM706i', 16777216, 231, 235),('D505i', 262144, 240, 270),('SO505i', 262144, 256, 240),('SH505i', 262144, 240, 252),('N505i', 262144, 240, 270),('F505i', 262144, 240, 268),('P505i', 65536, 240, 266),('D505iS', 262144, 240, 270),('P505iS', 65536, 240, 266),('N505iS', 262144, 240, 270),('SO505iS', 262144, 240, 256),('SH505iS', 262144, 240, 252),('F505iGPS', 262144, 240, 268),('D252i', 262144, 176, 198),('SH252i', 262144, 240, 252),('P252i', 65536, 132, 144),('N252i', 65536, 132, 140),('P252iS', 65536, 132, 144),('D506i', 262144, 240, 270),('F506i', 262144, 240, 268),('N506i', 262144, 240, 295),('P506iC', 65536, 240, 266),('SH506iC', 262144, 240, 252),('SO506iC', 262144, 240, 256),('N506iS', 262144, 240, 295),('SO506i', 262144, 240, 256),('SO506iS', 262144, 240, 256),('N506iSII', 262144, 240, 295),('P506iCII', 65536, 240, 266),('D253i', 262144, 176, 198),('N253i', 65536, 160, 180),('P253i', 65536, 132, 144),('D253iWM', 262144, 220, 144),('P253iS', 65536, 132, 144),('P213i', 65536, 132, 144),('F900i', 262144, 230, 240),('N900i', 65536, 240, 269),('P900i', 65536, 240, 266),('SH900i', 262144, 240, 252),('F900iT', 262144, 230, 240),('P900iV', 262144, 240, 266),('N900iS', 65536, 240, 269),('D900i', 262144, 240, 270),('F900iC', 262144, 230, 240),('N900iL', 65536, 240, 269),('N900iG', 65536, 240, 269),('F880iES', 65536, 240, 256),('SH901iC', 262144, 240, 252),('F901iC', 262144, 230, 240),('N901iC', 65536, 240, 270),('D901i', 262144, 230, 240),('P901i', 65536, 240, 270),('SH901iS', 262144, 240, 252),('F901iS', 262144, 230, 240),('D901iS', 262144, 230, 240),('P901iS', 65536, 240, 270),('N901iS', 65536, 240, 270),('P901iTV', 65536, 240, 270),('F700i', 262144, 230, 240),('SH700i', 262144, 240, 252),('N700i', 65536, 240, 270),('P700i', 65536, 240, 270),('F700iS', 262144, 230, 240),('SH700iS', 262144, 240, 252),('SA700iS', 65536, 240, 252),('SH851i', 262144, 240, 252),('P851i', 65536, 240, 270),('F881iES', 65536, 240, 256),('D701i', 65536, 230, 240),('N701i', 65536, 240, 270),('P701iD', 65536, 240, 270),('D701iWM', 65536, 230, 240),('N701iECO', 65536, 240, 270),('SA800i', 65536, 240, 252),('L600i', 65536, 170, 189),('N600i', 65536, 176, 180),('L601i', 65536, 170, 189),('M702iS', 262144, 240, 267),('M702iG', 262144, 240, 267),('L602i', 65536, 170, 189),('F902i', 262144, 230, 240),('D902i', 262144, 230, 320),('N902i', 262144, 240, 270),('P902i', 262144, 240, 270),('SH902i', 262144, 240, 240),('SO902i', 262144, 240, 256),('SH902iS', 262144, 240, 240),('P902iS', 262144, 240, 270),('N902iS', 262144, 240, 270),('D902iS', 262144, 230, 320),('F902iS', 262144, 230, 240),('SO902iWP+', 262144, 240, 256),('SH902iSL', 262144, 240, 240),('N902iX', 262144, 240, 270),('N902iL', 262144, 240, 270),('P702i', 262144, 240, 270),('N702iD', 65536, 240, 270),('F702iD', 262144, 230, 240),('SH702iD', 262144, 240, 240),('D702i', 262144, 230, 240),('SO702i', 262144, 240, 256),('D702iBCL', 262144, 230, 240),('SA702i', 65536, 240, 252),('SH702iS', 262144, 240, 240),('N702iS', 65536, 240, 270),('P702iD', 262144, 240, 270),('D702iF', 262144, 230, 240),('D851iWM', 262144, 230, 320),('F882iES', 65536, 240, 256),('N601i', 65536, 240, 270),('D800iDS', 262144, 230, 240),('P703imyu', 262144, 240, 270),('F883i', 65536, 240, 256),('F883iS', 65536, 240, 256),('P704imyu', 262144, 240, 270),('L704i', 262144, 240, 280),('L705i', 262144, 240, 280),('L705iX', 262144, 240, 280),('L852i', 65536, 240, 298),('L706ie', 262144, 240, 280),('SH903i', 262144, 240, 320),('P903i', 262144, 240, 270),('N903i', 262144, 240, 270),('D903i', 262144, 230, 320),('F903i', 262144, 230, 240),('SO903i', 262144, 240, 368),('D903iTV', 262144, 230, 320),('F903iX', 262144, 230, 240),('P903iTV', 262144, 240, 350),('SH903iTV', 262144, 240, 320),('F903iBSC', 262144, 230, 240),('P903iX', 262144, 240, 270),('SO903iTV', 262144, 240, 368),('N703iD', 262144, 240, 270),('F703i', 262144, 230, 240),('P703i', 262144, 240, 270),('D703i', 262144, 230, 240),('SH703i', 262144, 240, 240),('N703imyu', 262144, 240, 270),('SO703i', 262144, 240, 368),('SH904i', 262144, 240, 320),('N904i', 262144, 240, 352),('F904i', 262144, 240, 352),('D904i', 262144, 240, 320),('P904i', 262144, 240, 350),('SO704i', 262144, 240, 368),('F704i', 262144, 230, 240),('N704imyu', 262144, 240, 270),('SH704i', 262144, 240, 320),('D704i', 262144, 230, 240),('P704i', 262144, 240, 270),('F883iES', 65536, 240, 256),('F883iESS', 65536, 240, 256),('F801i', 65536, 240, 352),('F705i', 262144, 240, 352),('D705i', 262144, 240, 320),('D705imyu', 262144, 240, 240),('SH705i', 262144, 240, 320),('SH705iII', 262144, 240, 320),('SH706ie', 262144, 240, 320),('F-05A', 65536, 240, 352),('SH905i', 16777216, 240, 320),('D905i', 262144, 240, 352),('N905i', 262144, 240, 320),('P905i', 262144, 240, 350),('F905i', 16777216, 240, 352),('SO905i', 16777216, 240, 368),('N905imyu', 262144, 240, 320),('N905iBiz', 262144, 240, 320),('SH905iTV', 16777216, 240, 320),('SO905iCS', 16777216, 240, 368),('F905iBiz', 16777216, 240, 352),('P905iTV', 262144, 240, 350),('P705i', 262144, 240, 350),('N705i', 262144, 240, 320),('N705imyu', 262144, 240, 320),('P705imyu', 262144, 240, 350),('SO705i', 262144, 240, 320),('P705iCL', 262144, 240, 350),('F884i', 262144, 240, 364),('F884iES', 262144, 240, 282),('N906iL', 262144, 240, 320),('N706i', 262144, 240, 320),('SO706i', 262144, 240, 320),('P706imyu', 262144, 240, 350),('N706ie', 262144, 240, 320),('N706iII', 262144, 240, 320),('N-03A', 262144, 240, 320),('P906i', 262144, 240, 350),('SO906i', 16777216, 240, 368),('SH906i', 16777216, 240, 320),('N906imyu', 262144, 240, 320),('F906i', 16777216, 240, 352),('N906i', 262144, 240, 320),('SH906iTV', 16777216, 240, 320),('F706i', 262144, 240, 352),('SH706i', 16777216, 240, 320),('P706ie', 262144, 240, 350),('SH706iw', 16777216, 240, 320),('F-01A', 16777216, 240, 352),('F-02A', 262144, 240, 352),('F-03A', 16777216, 240, 352),('F-04A', 262144, 240, 352),('F-06A', 16777216, 240, 352),('P-01A', 262144, 240, 350),('P-02A', 262144, 240, 350),('P-03A', 262144, 240, 350),('P-04A', 262144, 240, 350),('P-05A', 262144, 240, 350),('SH-01A', 16777216, 240, 320),('SH-02A', 16777216, 240, 320),('SH-03A', 16777216, 240, 320),('SH-04A', 16777216, 240, 320),('N-01A', 262144, 240, 320),('N-02A', 262144, 240, 320),('N-04A', 262144, 240, 320);
UPDATE docomo_extends SET htmlVersion='1.0' WHERE model IN('D501i','F501i','N501i','P501i');
UPDATE docomo_extends SET htmlVersion='2.0' WHERE model IN('D502i','F502i','N502i','P502i','NM502i','SO502i','F502it','N502it','SO502iWM','SH821i','N821i','P821i','D209i','ER209i','F209i','KO209i','N209i','P209i','P209iS','R209i','P651ps','R691i','F210i','N210i','P210i','KO210i','F671i');
UPDATE docomo_extends SET htmlVersion='3.0' WHERE model IN('D210i','SO210i','F503i','F503iS','P503i','P503iS','N503i','N503iS','SO503i','SO503iS','D503i','D503iS','F211i','D211i','N211i','N211iS','P211i','P211iS','SO211i','R211i','SH251i','SH251iS','R692i','N2001','N2002','P2002','D2101V','P2101V','SH2101V','T2101V');
UPDATE docomo_extends SET htmlVersion='4.0' WHERE model IN('D504i','F504i','F504iS','N504i','N504iS','SO504i','P504i','P504iS','D251i','D251iS','F251i','N251i','N251iS','P251iS','F671iS','F212i','SO212i','F661i','F672i','SO213i','SO213iS','SO213iWR','F2051','N2051','P2102V','F2102V','N2102V','N2701','NM850iG','NM705i','NM706i');
UPDATE docomo_extends SET htmlVersion='5.0' WHERE model IN('D505i','SO505i','SH505i','N505i','F505i','P505i','D505iS','P505iS','N505iS','SO505iS','SH505iS','F505iGPS','D252i','SH252i','P252i','N252i','P252iS','D506i','F506i','N506i','P506iC','SH506iC','SO506iC','N506iS','SO506i','SO506iS','N506iSII','P506iCII','D253i','N253i','P253i','D253iWM','P253iS','P213i','F900i','N900i','P900i','SH900i','F900iT','P900iV','N900iS','D900i','F900iC','N900iL','N900iG','F880iES','SH901iC','F901iC','N901iC','D901i','P901i','SH901iS','F901iS','D901iS','P901iS','N901iS','P901iTV','F700i','SH700i','N700i','P700i','F700iS','SH700iS','SA700iS','SH851i','P851i','F881iES','D701i','N701i','P701iD','D701iWM','N701iECO','SA800i','L600i','N600i','L601i','M702iS','M702iG','L602i');
UPDATE docomo_extends SET htmlVersion='6.0' WHERE model IN('F902i','D902i','N902i','P902i','SH902i','SO902i','SH902iS','P902iS','N902iS','D902iS','F902iS','SO902iWP+','SH902iSL','N902iX','N902iL','P702i','N702iD','F702iD','SH702iD','D702i','SO702i','D702iBCL','SA702i','SH702iS','N702iS','P702iD','D702iF','D851iWM','F882iES','N601i','D800iDS','P703imyu','F883i','F883iS','P704imyu','L704i','L705i','L705iX','L852i','L706ie','L-01A');
UPDATE docomo_extends SET htmlVersion='7.0' WHERE model IN('SH903i','P903i','N903i','D903i','F903i','SO903i','D903iTV','F903iX','P903iTV','SH903iTV','F903iBSC','P903iX','SO903iTV','N703iD','F703i','P703i','D703i','SH703i','N703imyu','SO703i','SH904i','N904i','F904i','D904i','P904i','SO704i','F704i','N704imyu','SH704i','D704i','P704i','F883iES','F883iESS','F801i','F705i','D705i','D705imyu','SH705i','SH705iII','SH706ie','F-05A');
UPDATE docomo_extends SET htmlVersion='7.1' WHERE model IN('SH905i','D905i','N905i','P905i','F905i','SO905i','N905imyu','N905iBiz','SH905iTV','SO905iCS','F905iBiz','P905iTV','P705i','N705i','N705imyu','P705imyu','SO705i','P705iCL','F884i','F884iES','N906iL','N706i','SO706i','P706imyu','N706ie','N706iII','N-03A');
UPDATE docomo_extends SET htmlVersion='7.2' WHERE model IN('P906i','SO906i','SH906i','N906imyu','F906i','N906i','SH906iTV','F706i','SH706i','P706ie','SH706iw','F-01A','F-02A','F-03A','F-04A','F-06A','P-01A','P-02A','P-03A','P-04A','P-05A','SH-01A','SH-02A','SH-03A','SH-04A','N-01A','N-02A','N-04A');
