aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-08-26 21:51:12 -0700
committerFriendika <info@friendika.com>2011-08-26 21:51:12 -0700
commite3dbb6339386fce5cef2d22be6edd63b93a9b41d (patch)
tree7bc37bbe2b3fa531da5eec4ef6c5aed6b9875340
parentf48a758a1e8bce122957fb2fc4c65966290cfead (diff)
downloadvolse-hubzilla-e3dbb6339386fce5cef2d22be6edd63b93a9b41d.tar.gz
volse-hubzilla-e3dbb6339386fce5cef2d22be6edd63b93a9b41d.tar.bz2
volse-hubzilla-e3dbb6339386fce5cef2d22be6edd63b93a9b41d.zip
fix any update issues that may arise from update 1081
-rw-r--r--boot.php2
-rw-r--r--update.php10
2 files changed, 10 insertions, 2 deletions
diff --git a/boot.php b/boot.php
index 41951b06b..cb18b0560 100644
--- 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' );
diff --git a/update.php b/update.php
index d92b1dd91..c23ce95c6 100644
--- a/update.php
+++ b/update.php
@@ -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) {