<?php
-define( 'UPDATE_VERSION' , 1080 );
+define( 'UPDATE_VERSION' , 1087 );
/**
*
}
+function update_1080() {
+ q("ALTER TABLE `fcontact` ADD `updated` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'");
+}
+
+function update_1081() {
+ // there was a typo in update 1081 so it was corrected and moved up to 1082
+}
+
+function update_1082() {
+ q("ALTER TABLE `photo` ADD `guid` CHAR( 64 ) NOT NULL AFTER `contact-id`,
+ ADD INDEX ( `guid` ) ");
+ // make certain the following code is only executed once
+ $r = q("select `id` from `photo` where `guid` != '' limit 1");
+ if($r && count($r))
+ return;
+ $r = q("SELECT distinct(`resource-id`) FROM `photo` WHERE 1 group by `id`");
+ if(count($r)) {
+ foreach($r as $rr) {
+ $guid = get_guid();
+ q("update `photo` set `guid` = '%s' where `resource-id` = '%s'",
+ dbesc($guid),
+ dbesc($rr['resource-id'])
+ );
+ }
+ }
+}
+
+function update_1083() {
+ q("CREATE TABLE IF NOT EXISTS `deliverq` (
+ `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+ `cmd` CHAR( 32 ) NOT NULL ,
+ `item` INT NOT NULL ,
+ `contact` INT NOT NULL
+ ) ENGINE = MYISAM ");
+
+}
+
+function update_1084() {
+ q("ALTER TABLE `contact` ADD `attag` CHAR( 255 ) NOT NULL AFTER `nick` ");
+}
+
+function update_1085() {
+ q("CREATE TABLE IF NOT EXISTS `search` (
+ `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+ `uid` INT NOT NULL ,
+ `term` CHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ INDEX ( `uid` ),
+ INDEX ( `term` )
+ ) ENGINE = MYISAM ");
+}
+
+function update_1086() {
+ q("ALTER TABLE `item` ADD `bookmark` tinyint(1) NOT NULL DEFAULT '0' AFTER `starred` ");
+}
+