diff options
Diffstat (limited to 'install/update.php')
-rw-r--r-- | install/update.php | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/install/update.php b/install/update.php index ace5239b5..d6b543466 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ <?php -define( 'UPDATE_VERSION' , 1156 ); +define( 'UPDATE_VERSION' , 1158 ); /** * @@ -1885,3 +1885,35 @@ function update_r1155() { return UPDATE_FAILED; } + +function update_r1156() { + $r1 = q("ALTER TABLE mail ADD conv_guid CHAR( 255 ) NOT NULL DEFAULT '' "); + $r2 = q("create index conv_guid on mail ( conv_guid ) "); + + $r3 = q("select mail.id, mail.convid, conv.guid from mail left join conv on mail.convid = conv.id where true"); + if($r3) { + foreach($r3 as $rr) { + if($rr['convid']) { + q("update mail set conv_guid = '%s' where id = %d", + dbesc($rr['guid']), + intval($rr['id']) + ); + } + } + } + + if($r1 && $r2) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + +function update_r1157() { + $r1 = q("alter table site add site_project char(255) not null default '' "); + $r2 = q("create index site_project on site ( site_project ) "); + if($r1 && $r2) + return UPDATE_SUCCESS; + return UPDATE_FAILED; + +} + + |