diff options
author | friendica <info@friendica.com> | 2013-03-21 18:25:41 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-03-21 18:25:41 -0700 |
commit | ddf5bf8968a12501939cd37898d303967b748600 (patch) | |
tree | 9ec457948c7fadae811b1af676257c43bab93d4c /install/update.php | |
parent | b3c699d49a5ef2023fcbdaa8226be95fce9589a7 (diff) | |
download | volse-hubzilla-ddf5bf8968a12501939cd37898d303967b748600.tar.gz volse-hubzilla-ddf5bf8968a12501939cd37898d303967b748600.tar.bz2 volse-hubzilla-ddf5bf8968a12501939cd37898d303967b748600.zip |
rename 'uri' (and parent_uri) to 'mid' (and parent_mid) since these no longer remotely resemble uri's and are actually message_id's. This change is potentially destabilising because it touches a lot of code and structure. But it has to get done and there's no better time than the present.
Diffstat (limited to 'install/update.php')
-rw-r--r-- | install/update.php | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/install/update.php b/install/update.php index 533fd63e5..493a5478b 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ <?php -define( 'UPDATE_VERSION' , 1037 ); +define( 'UPDATE_VERSION' , 1038 ); /** * @@ -464,5 +464,36 @@ KEY `k` ( `k` ) } function update_r1036() { - q("ALTER TABLE `profile` ADD `channels` TEXT NOT NULL AFTER `contact` "); + $r = q("ALTER TABLE `profile` ADD `channels` TEXT NOT NULL AFTER `contact` "); + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; + } + + +function update_r1037() { + $r1 = q("ALTER TABLE `item` CHANGE `uri` `mid` CHAR( 255 ) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '', +CHANGE `parent_uri` `parent_mid` CHAR( 255 ) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '', + DROP INDEX `uri` , +ADD INDEX `mid` ( `mid` ), +DROP INDEX `parent_uri` , +ADD INDEX `parent_mid` ( `parent_mid` ), + DROP INDEX `uid_uri` , +ADD INDEX `uid_mid` ( `mid` , `uid` ) "); + + $r2 = q("ALTER TABLE `mail` CHANGE `uri` `mid` CHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , +CHANGE `parent_uri` `parent_mid` CHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , +DROP INDEX `uri` , +ADD INDEX `mid` ( `mid` ), + DROP INDEX `parent_uri` , +ADD INDEX `parent_mid` ( `parent_mid` ) "); + + if($r1 && $r2) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + + + + |