- q("ALTER TABLE `config` ADD UNIQUE `access` ( `cat` , `k` ) ");
- q("ALTER TABLE `pconfig` ADD UNIQUE `access` ( `uid` , `cat` , `k` )");
-
-}
-
-
-function update_1137() {
- q("alter table item_id DROP `face` , DROP `dspr` , DROP `twit` , DROP `stat` ");
- q("ALTER TABLE `item_id` ADD `sid` CHAR( 255 ) NOT NULL AFTER `uid` , ADD `service` CHAR( 255 ) NOT NULL AFTER `sid` , add index (`sid`), add index ( `service`) ");
-}
-
-function update_1138() {
- q("alter table contact add archive tinyint(1) not null default '0' after hidden, add index (archive)");
-}
-
-function update_1139() {
- $r = q("alter table user add account_removed tinyint(1) not null default '0' after expire, add index(account_removed) ");
- if(! $r)
- return UPDATE_FAILED ;
- return UPDATE_SUCCESS ;
-}
-
-function update_1140() {
- $r = q("alter table addon add hidden tinyint(1) not null default '0' after installed, add index(hidden) ");
- if(! $r)
- return UPDATE_FAILED ;
- return UPDATE_SUCCESS ;
-}
-
-function update_1141() {
- $r = q("alter table glink add zcid int(11) not null after gcid, add index(zcid) ");
- if(! $r)
- return UPDATE_FAILED ;
- return UPDATE_SUCCESS ;
-}
-
-
-function update_1142() {
- $r = q("alter table user add service_class char(32) not null after expire_notification_sent, add index(service_class) ");
- if(! $r)
- return UPDATE_FAILED ;
- return UPDATE_SUCCESS ;
-}
-
-function update_1143() {
- $r = q("alter table user add def_gid int(11) not null default '0' after service_class");
- if(! $r)
- return UPDATE_FAILED ;
- return UPDATE_SUCCESS ;
-}
-
-function update_1144() {
- $r = q("alter table contact add prv tinyint(1) not null default '0' after forum");
- if(! $r)
- return UPDATE_FAILED ;
- return UPDATE_SUCCESS ;
-}
-
-function update_1145() {
- $r = q("alter table profile add howlong datetime not null default '0001-01-01 00:00:00' after `with`");
- if(! $r)
- return UPDATE_FAILED ;
- return UPDATE_SUCCESS ;
-}
-
-function update_1146() {
- $r = q("alter table profile add hometown char(255) not null after `country-name`, add index ( `hometown` ) ");
- if(! $r)
- return UPDATE_FAILED ;
- return UPDATE_SUCCESS ;
-}
-
-function update_1147() {
- $r1 = q("ALTER TABLE `sign` ALTER `iid` SET DEFAULT '0'");
- $r2 = q("ALTER TABLE `sign` ADD `retract_iid` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `iid`");
- $r3 = q("ALTER TABLE `sign` ADD INDEX ( `retract_iid` )");
- if((! $r1) || (! $r2) || (! $r3))
- return UPDATE_FAILED ;
- return UPDATE_SUCCESS ;
-}
-
-function update_1148() {
- $r = q("ALTER TABLE photo ADD type CHAR(128) NOT NULL DEFAULT 'image/jpeg' AFTER filename");
- if (!$r)
- return UPDATE_FAILED;
- return UPDATE_SUCCESS;
-}
-
-
-function update_1149() {
- $r1 = q("ALTER TABLE profile ADD likes text NOT NULL after prv_keywords");
- $r2 = q("ALTER TABLE profile ADD dislikes text NOT NULL after likes");
- if (! ($r1 && $r2))
- return UPDATE_FAILED;
- return UPDATE_SUCCESS;
-}
-
-
-function update_1150() {
- $r = q("ALTER TABLE event ADD summary text NOT NULL after finish, add index ( uid ), add index ( cid ), add index ( uri ), add index ( `start` ), add index ( finish ), add index ( `type` ), add index ( adjust ) ");
- if(! $r)
- return UPDATE_FAILED;
- return UPDATE_SUCCESS;
-}
-
-
-function update_1151() {
- $r = q("CREATE TABLE IF NOT EXISTS locks (
- id INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
- name CHAR( 128 ) NOT NULL ,
- locked TINYINT( 1 ) NOT NULL DEFAULT '0'
- ) ENGINE = MYISAM DEFAULT CHARSET=utf8 ");
- if (!$r)
- return UPDATE_FAILED;
- return UPDATE_SUCCESS;
-}
-
-function update_1152() {
- $r = q("CREATE TABLE IF NOT EXISTS `term` (
- `tid` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
- `oid` INT UNSIGNED NOT NULL ,
- `otype` TINYINT( 3 ) UNSIGNED NOT NULL ,
- `type` TINYINT( 3 ) UNSIGNED NOT NULL ,
- `term` CHAR( 255 ) NOT NULL ,
- `url` CHAR( 255 ) NOT NULL,
- KEY `oid` ( `oid` ),
- KEY `otype` ( `otype` ),
- KEY `type` ( `type` ),
- KEY `term` ( `term` )
- ) ENGINE = MYISAM DEFAULT CHARSET=utf8 ");
- if (!$r)
- return UPDATE_FAILED;
- return UPDATE_SUCCESS;
-}
-
-function update_1153() {
- $r = q("ALTER TABLE `hook` ADD `priority` INT(11) UNSIGNED NOT NULL DEFAULT '0'");
-
- if(!$r) return UPDATE_FAILED;
- return UPDATE_SUCCESS;
-}
-
-function update_1154() {
- $r = q("ALTER TABLE `event` ADD `ignore` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `adjust` , ADD INDEX ( `ignore` )");
-
- if(!$r) return UPDATE_FAILED;
- return UPDATE_SUCCESS;
-}
-
-function update_1155() {
- $r1 = q("ALTER TABLE `item_id` DROP PRIMARY KEY");
- $r2 = q("ALTER TABLE `item_id` ADD `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST");
- $r3 = q("ALTER TABLE `item_id` ADD INDEX ( `iid` ) ");
-
- if($r1 && $r2 && $r3)
- return UPDATE_SUCCESS;
-
- return UPDATE_FAILED;
-}
-
-function update_1156() {
- $r = q("ALTER TABLE `photo` ADD `datasize` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `width` ,
-ADD INDEX ( `datasize` ) ");
-
- if(!$r) return UPDATE_FAILED;
- return UPDATE_SUCCESS;
-}
-
-function update_1157() {
- $r = q("CREATE TABLE IF NOT EXISTS `dsprphotoq` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `uid` int(11) NOT NULL,
- `msg` mediumtext NOT NULL,
- `attempt` tinyint(4) NOT NULL,
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8"
- );
-
- if($r)
- return UPDATE_SUCCESS;
-}
-
-function update_1158() {
- Config::set('system', 'maintenance', 1);
-
- // Wait for 15 seconds for current requests to
- // clear before locking up the database
- sleep(15);
-
- $r = q("CREATE INDEX event_id ON item(`event-id`)");
- Config::set('system', 'maintenance', 0);
-
- if($r)
- return UPDATE_SUCCESS;
-
- return UPDATE_FAILED;
-}
-
-function update_1159() {
- $r = q("ALTER TABLE `term` ADD `aid` int(10) unsigned NOT NULL DEFAULT '0',
- ADD `uid` int(10) unsigned NOT NULL DEFAULT '0',
- ADD INDEX (`uid`),
- ADD INDEX (`aid`)");
-
- if(!$r)
- return UPDATE_FAILED;
-
- return UPDATE_SUCCESS;
-}
-
-function update_1160() {
- Config::set('system', 'maintenance', 1);
-
- // Wait for 15 seconds for current requests to
- // clear before locking up the database
- sleep(15);
-
- $r = q("ALTER TABLE `item` ADD `mention` TINYINT(1) NOT NULL DEFAULT '0', ADD INDEX (`mention`)");
- Config::set('system', 'maintenance', 0);
-
- if(!$r)
- return UPDATE_FAILED;
-
- return UPDATE_SUCCESS;
-}
-
-function update_1161() {
- $r = q("ALTER TABLE `pconfig` ADD INDEX (`cat`)");
-
- if(!$r)
- return UPDATE_FAILED;
-
- return UPDATE_SUCCESS;
-}
-
-function update_1162() {
- require_once('include/tags.php');
- update_items();
-
- return UPDATE_SUCCESS;
-}
-
-function update_1163() {
- Config::set('system', 'maintenance', 1);
-
- $r = q("ALTER TABLE `item` ADD `network` char(32) NOT NULL");
-
- Config::set('system', 'maintenance', 0);
- if(!$r)
- return UPDATE_FAILED;
-
- return UPDATE_SUCCESS;
-}
-function update_1164() {
- Config::set('system', 'maintenance', 1);
-
- $r = q("UPDATE `item` SET `network`='%s' WHERE `contact-id` IN (SELECT `id` FROM`contact` WHERE `network` = '' AND `contact`.`uid` = `item`.`uid`)",
- NETWORK_DFRN);
-
- $r = q("UPDATE `item` SET `network`='%s' WHERE `contact-id` IN (SELECT `id` FROM`contact` WHERE `network` = '%s' AND `contact`.`uid` = `item`.`uid`)",
- NETWORK_DFRN, NETWORK_DFRN);
-
- $r = q("UPDATE `item` SET `network`='%s' WHERE `contact-id` IN (SELECT `id` FROM`contact` WHERE `network` = '%s' AND `contact`.`uid` = `item`.`uid`)",
- NETWORK_ZOT, NETWORK_ZOT);
-
- $r = q("UPDATE `item` SET `network`='%s' WHERE `contact-id` IN (SELECT `id` FROM`contact` WHERE `network` = '%s' AND `contact`.`uid` = `item`.`uid`)",
- NETWORK_OSTATUS, NETWORK_OSTATUS);
-
- $r = q("UPDATE `item` SET `network`='%s' WHERE `contact-id` IN (SELECT `id` FROM`contact` WHERE `network` = '%s' AND `contact`.`uid` = `item`.`uid`)",
- NETWORK_FEED, NETWORK_FEED);
-
- $r = q("UPDATE `item` SET `network`='%s' WHERE `contact-id` IN (SELECT `id` FROM`contact` WHERE `network` = '%s' AND `contact`.`uid` = `item`.`uid`)",
- NETWORK_DIASPORA, NETWORK_DIASPORA);
-
- $r = q("UPDATE `item` SET `network`='%s' WHERE `contact-id` IN (SELECT `id` FROM`contact` WHERE `network` = '%s' AND `contact`.`uid` = `item`.`uid`)",
- NETWORK_MAIL, NETWORK_MAIL);
-
- $r = q("UPDATE `item` SET `network`='%s' WHERE `contact-id` IN (SELECT `id` FROM`contact` WHERE `network` = '%s' AND `contact`.`uid` = `item`.`uid`)",
- NETWORK_MAIL2, NETWORK_MAIL2);
-
- $r = q("UPDATE `item` SET `network`='%s' WHERE `contact-id` IN (SELECT `id` FROM`contact` WHERE `network` = '%s' AND `contact`.`uid` = `item`.`uid`)",
- NETWORK_FACEBOOK, NETWORK_FACEBOOK);
-
- $r = q("UPDATE `item` SET `network`='%s' WHERE `contact-id` IN (SELECT `id` FROM`contact` WHERE `network` = '%s' AND `contact`.`uid` = `item`.`uid`)",
- NETWORK_LINKEDIN, NETWORK_LINKEDIN);
-
- $r = q("UPDATE `item` SET `network`='%s' WHERE `contact-id` IN (SELECT `id` FROM`contact` WHERE `network` = '%s' AND `contact`.`uid` = `item`.`uid`)",
- NETWORK_XMPP, NETWORK_XMPP);
-
- $r = q("UPDATE `item` SET `network`='%s' WHERE `contact-id` IN (SELECT `id` FROM`contact` WHERE `network` = '%s' AND `contact`.`uid` = `item`.`uid`)",
- NETWORK_MYSPACE, NETWORK_MYSPACE);
-
- $r = q("UPDATE `item` SET `network`='%s' WHERE `contact-id` IN (SELECT `id` FROM`contact` WHERE `network` = '%s' AND `contact`.`uid` = `item`.`uid`)",
- NETWORK_GPLUS, NETWORK_GPLUS);
-
- $r = q("UPDATE `item` SET `network`='%s' WHERE `contact-id` IN (SELECT `id` FROM`contact` WHERE `network` = '%s' AND `contact`.`uid` = `item`.`uid`)",
- NETWORK_PUMPIO, NETWORK_PUMPIO);
-
- $r = q("UPDATE `item` SET `network`='%s' WHERE `contact-id` IN (SELECT `id` FROM`contact` WHERE `network` = '%s' AND `contact`.`uid` = `item`.`uid`)",
- NETWORK_TWITTER, NETWORK_TWITTER);
-
- Config::set('system', 'maintenance', 0);
-
- return UPDATE_SUCCESS;
-}
-
-function update_1165() {
- $r = q("CREATE TABLE IF NOT EXISTS `push_subscriber` (
- `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
- `uid` INT NOT NULL,
- `callback_url` CHAR( 255 ) NOT NULL,
- `topic` CHAR( 255 ) NOT NULL,
- `nickname` CHAR( 255 ) NOT NULL,
- `push` INT NOT NULL,
- `last_update` DATETIME NOT NULL,
- `secret` CHAR( 255 ) NOT NULL
- ) ENGINE = MYISAM DEFAULT CHARSET=utf8 ");
- if (!$r)
- return UPDATE_FAILED;
-
- return UPDATE_SUCCESS;
-}