diff options
Diffstat (limited to 'update.php')
-rw-r--r-- | update.php | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/update.php b/update.php index adfb5fe02..80761cce4 100644 --- a/update.php +++ b/update.php @@ -1,6 +1,6 @@ <?php -define( 'UPDATE_VERSION' , 1081 ); +define( 'UPDATE_VERSION' , 1085 ); /** * @@ -673,4 +673,41 @@ function update_1079() { function update_1080() { q("ALTER TABLE `fcontact` ADD `updated` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'"); -}
\ No newline at end of file +} + +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` "); +} |