move hidewall to user table - queries are getting too complicated and servers falling over

This commit is contained in:
Friendika 2011-07-05 23:23:43 -07:00
parent c221d5ea59
commit 84d12c3e08
9 changed files with 34 additions and 30 deletions

View file

@ -1,6 +1,6 @@
<?php
define( 'UPDATE_VERSION' , 1074 );
define( 'UPDATE_VERSION' , 1075 );
/**
*
@ -590,3 +590,14 @@ function update_1073() {
q("ALTER TABLE `contact` ADD `remote_self` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `self` ");
}
function update_1074() {
q("ALTER TABLE `user` ADD `hidewall` TINYINT( 1) NOT NULL DEFAULT '0' AFTER `blockwall` ");
$r = q("SELECT `uid` FROM `profile` WHERE `is-default` = 1 AND `hidewall` = 1");
if(count($r)) {
foreach($r as $rr)
q("UPDATE `user` SET `hidewall` = 1 WHERE `uid` = %d LIMIT 1",
intval($rr['uid'])
);
}
q("ALTER TABLE `profile` DROP `hidewall`");
}