]> git.mxchange.org Git - friendica.git/commitdiff
fix any update issues that may arise from update 1081
authorFriendika <info@friendika.com>
Sat, 27 Aug 2011 04:51:12 +0000 (21:51 -0700)
committerFriendika <info@friendika.com>
Sat, 27 Aug 2011 04:51:12 +0000 (21:51 -0700)
boot.php
update.php

index 41951b06b26c96c1edb1ebd947d2381b91aa764f..cb18b0560489deabb425a13bbb3c496394486a29 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -9,7 +9,7 @@ require_once("include/pgettext.php");
 
 define ( 'FRIENDIKA_VERSION',      '2.2.1084' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
-define ( 'DB_UPDATE_VERSION',      1082      );
+define ( 'DB_UPDATE_VERSION',      1083      );
 
 define ( 'EOL',                    "<br />\r\n"     );
 define ( 'ATOM_TIME',              'Y-m-d\TH:i:s\Z' );
index d92b1dd91662ee62f8fb164f934d5a7506817b8a..c23ce95c6f912f8f88ee076948e174693dacc63d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-define( 'UPDATE_VERSION' , 1082 );
+define( 'UPDATE_VERSION' , 1083 );
 
 /**
  *
@@ -676,8 +676,16 @@ function update_1080() {
 }
 
 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) {