aboutsummaryrefslogtreecommitdiffstats
path: root/update.php
diff options
context:
space:
mode:
authorAlexander Kampmann <programmer@nurfuerspam.de>2012-04-05 13:27:09 +0200
committerAlexander Kampmann <programmer@nurfuerspam.de>2012-04-05 13:27:09 +0200
commitcbf4544887c7f496f2b2312727fe7bcb64a6d6c8 (patch)
tree6b327da2db68c6be38d917ee7e869e7546fa096d /update.php
parent9ba5fff865ed1d17c86982a5cf939f8e3e45da05 (diff)
downloadvolse-hubzilla-cbf4544887c7f496f2b2312727fe7bcb64a6d6c8.tar.gz
volse-hubzilla-cbf4544887c7f496f2b2312727fe7bcb64a6d6c8.tar.bz2
volse-hubzilla-cbf4544887c7f496f2b2312727fe7bcb64a6d6c8.zip
added index to config and pconfig table
changed config.php to use REPLACE instead of INSERT, this removes one db hit.
Diffstat (limited to 'update.php')
-rw-r--r--[-rwxr-xr-x]update.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/update.php b/update.php
index a69742a94..adb96b831 100755..100644
--- a/update.php
+++ b/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1133 );
+define( 'UPDATE_VERSION' , 1134 );
/**
*
@@ -1136,3 +1136,17 @@ INDEX ( `username` )
}
+function update_1133() {
+ //there can't be indexes with more than 1000 bytes in mysql,
+ //so change charset to be smaller
+ q("ALTER TABLE `config` CHANGE `cat` `cat` CHAR( 255 ) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL ,
+CHANGE `k` `k` CHAR( 255 ) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL");
+ //and add the index
+ q("ALTER TABLE `friendica`.`config` ADD UNIQUE `access` ( `cat` , `k` ) ");
+
+ //same thing for pconfig
+ q("ALTER TABLE `pconfig` CHANGE `cat` `cat` CHAR( 255 ) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL ,
+ CHANGE `k` `k` CHAR( 255 ) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL");
+
+ q("ALTER TABLE `friendica`.`pconfig` ADD UNIQUE `access` ( `uid` , `cat` , `k` )");
+}