aboutsummaryrefslogtreecommitdiffstats
path: root/update.php
diff options
context:
space:
mode:
Diffstat (limited to 'update.php')
-rw-r--r--update.php13
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