aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-01-30 18:20:14 -0800
committerfriendica <info@friendica.com>2013-01-30 18:20:14 -0800
commit3d06f3964f7c5b36a151268c37fcac4d87b49e76 (patch)
tree1897d9dddf86e82522af262ffb5ce558a77b26c5
parent3767bba3c3669b6e882139abfaa3553db61d1474 (diff)
downloadvolse-hubzilla-3d06f3964f7c5b36a151268c37fcac4d87b49e76.tar.gz
volse-hubzilla-3d06f3964f7c5b36a151268c37fcac4d87b49e76.tar.bz2
volse-hubzilla-3d06f3964f7c5b36a151268c37fcac4d87b49e76.zip
add item revision column and index
-rw-r--r--boot.php2
-rw-r--r--install/database.sql2
-rw-r--r--install/update.php9
3 files changed, 11 insertions, 2 deletions
diff --git a/boot.php b/boot.php
index 266347700..824fbbc94 100644
--- a/boot.php
+++ b/boot.php
@@ -16,7 +16,7 @@ require_once('include/features.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica Red');
define ( 'FRIENDICA_VERSION', trim(file_get_contents('version.inc')) . 'R');
define ( 'ZOT_REVISION', 1 );
-define ( 'DB_UPDATE_VERSION', 1023 );
+define ( 'DB_UPDATE_VERSION', 1024 );
define ( 'EOL', '<br />' . "\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
diff --git a/install/database.sql b/install/database.sql
index ba063bfa4..17d71e7af 100644
--- a/install/database.sql
+++ b/install/database.sql
@@ -451,6 +451,7 @@ CREATE TABLE IF NOT EXISTS `item` (
`body` mediumtext NOT NULL,
`app` char(255) NOT NULL DEFAULT '',
`lang` char(64) NOT NULL DEFAULT '',
+ `revision` int(10) unsigned NOT NULL DEFAULT '0',
`verb` char(255) NOT NULL DEFAULT '',
`obj_type` char(255) NOT NULL DEFAULT '',
`object` text NOT NULL,
@@ -495,6 +496,7 @@ CREATE TABLE IF NOT EXISTS `item` (
KEY `item_private` (`item_private`),
KEY `llink` (`llink`),
KEY `expires` (`expires`),
+ KEY `revision` (`revision`),
FULLTEXT KEY `title` (`title`),
FULLTEXT KEY `body` (`body`),
FULLTEXT KEY `allow_cid` (`allow_cid`),
diff --git a/install/update.php b/install/update.php
index b0eed4818..7eb7d719f 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1023 );
+define( 'UPDATE_VERSION' , 1024 );
/**
*
@@ -309,3 +309,10 @@ function update_r1022() {
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
+
+function update_r1023() {
+ $r = q("ALTER TABLE `item` ADD `revision` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `lang` , add index ( revision ) ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}