diff options
Diffstat (limited to 'update.php')
-rw-r--r-- | update.php | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/update.php b/update.php index f94e78d72..2f9277dae 100644 --- a/update.php +++ b/update.php @@ -1,6 +1,6 @@ <?php -define( 'UPDATE_VERSION' , 1087 ); +define( 'UPDATE_VERSION' , 1092 ); /** * @@ -726,3 +726,47 @@ function update_1086() { q("ALTER TABLE `item` ADD `bookmark` tinyint(1) NOT NULL DEFAULT '0' AFTER `starred` "); } +function update_1087() { + q("ALTER TABLE `item` ADD `commented` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `edited` "); + + $r = q("SELECT `id` FROM `item` WHERE `parent` = `id` "); + if(count($r)) { + foreach($r as $rr) { + $x = q("SELECT max(`created`) AS `cdate` FROM `item` WHERE `parent` = %d LIMIT 1", + intval($rr['id']) + ); + if(count($x)) + q("UPDATE `item` SET `commented` = '%s' WHERE `id` = %d LIMIT 1", + dbesc($x[0]['cdate']), + intval($rr['id']) + ); + } + } +} + +function update_1088() { + q("ALTER TABLE `user` ADD `account_expired` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `expire` , + ADD `account_expires_on` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `account_expired` , + ADD `expire_notification_sent` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `account_expires_on` "); +} + +function update_1089() { + q("ALTER TABLE `user` ADD `blocktags` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `hidewall` "); +} + +function update_1090() { + q("ALTER TABLE `contact` ADD `batch` char(255) NOT NULL AFTER `prvkey` "); + + q("UPDATE `contact` SET `batch` = concat(substring_index(`url`,'/',3),'/receive/public') WHERE `network` = 'dspr' "); + +} + +function update_1091() { + + // catch a few stragglers that may have crept in before we added this on remote connects + q("UPDATE `contact` SET `batch` = concat(substring_index(`url`,'/',3),'/receive/public') WHERE `network` = 'dspr' AND `batch` = '' "); + q("ALTER TABLE `queue` ADD `batch` TINYINT( 1 ) NOT NULL DEFAULT '0' "); + q("ALTER TABLE `fcontact` ADD `batch` char(255) NOT NULL AFTER `addr` "); + +} + |