diff options
author | Mike Macgirvin <mike@macgirvin.com> | 2010-10-23 01:20:26 -0700 |
---|---|---|
committer | Mike Macgirvin <mike@macgirvin.com> | 2010-10-23 01:20:26 -0700 |
commit | b8b227b32882fb511c8481a41c53637e7ce7707a (patch) | |
tree | 9116351081efa6547268a62332dc4385b1422fbd /update.php | |
parent | d850badf2b5717afe39a5fd96dabd29aa013910a (diff) | |
download | volse-hubzilla-b8b227b32882fb511c8481a41c53637e7ce7707a.tar.gz volse-hubzilla-b8b227b32882fb511c8481a41c53637e7ce7707a.tar.bz2 volse-hubzilla-b8b227b32882fb511c8481a41c53637e7ce7707a.zip |
add nicknames to contact records (going forward and retroactive)
Diffstat (limited to 'update.php')
-rw-r--r-- | update.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/update.php b/update.php index 65713583b..f0d72ef16 100644 --- a/update.php +++ b/update.php @@ -80,3 +80,16 @@ function update_1009() { function update_1010() { q("ALTER TABLE `contact` ADD `lrdd` CHAR( 255 ) NOT NULL AFTER `url` "); } + +function update_1011() { + q("ALTER TABLE `contact` ADD `nick` CHAR( 255 ) NOT NULL AFTER `name` "); + $r = q("SELECT * FROM `contact` WHERE 1"); + if(count($r)) { + foreach($r as $rr) { + q("UPDATE `contact` SET `nick` = '%s' WHERE `id` = %d LIMIT 1", + dbesc(basename($rr['url'])), + intval($rr['id']) + ); + } + } +}
\ No newline at end of file |