]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
fixes #1329 - schema for river is fixed - was incomplete before
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 12 Nov 2009 01:21:08 +0000 (01:21 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 12 Nov 2009 01:21:08 +0000 (01:21 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@3667 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/river2.php
engine/schema/mysql.sql
engine/schema/upgrades/2009091901.sql

index 799af013cbafae33c7062507fb3614a7a6266661..09a6b0cc743eb52c57298590011b5a8656de6a21 100644 (file)
@@ -57,8 +57,8 @@ function add_to_river($view,$action_type,$subject_guid,$object_guid,$access_id =
                " view = '{$view}', " .
                " subject_guid = {$subject_guid}, " .
                " object_guid = {$object_guid}, " .
-               " posted = {$posted}, " .
-               " annotation_id = {$annotation_id} ");
+               " annotation_id = {$annotation_id}, " .
+               " posted = {$posted} ");
 }
 
 /**
@@ -119,7 +119,9 @@ function update_river_access_by_object($object_guid, $access_id) {
  *
  * @param int|array $subject_guid Acting entity to restrict to. Default: all
  * @param int|array $object_guid Entity being acted on to restrict to. Default: all
- * @param string $subject_relationship If set to a relationship type, this will use $subject_guid as the starting point and set the subjects to be all users this entity has this relationship with (eg 'friend'). Default: blank
+ * @param string $subject_relationship If set to a relationship type, this will use 
+ *     $subject_guid as the starting point and set the subjects to be all users this 
+ *     entity has this relationship with (eg 'friend'). Default: blank
  * @param string $type The type of entity to restrict to. Default: all
  * @param string $subtype The subtype of entity to restrict to. Default: all
  * @param string $action_type The type of river action to restrict to. Default: all
@@ -215,7 +217,8 @@ function get_river_items($subject_guid = 0, $object_guid = 0, $subject_relations
        $whereclause = implode(' and ', $where);
 
        // Construct main SQL
-       $sql = "select id,type,subtype,action_type,access_id,view,subject_guid,object_guid,posted,annotation_id from {$CONFIG->dbprefix}river where {$whereclause} order by posted desc limit {$offset},{$limit}";
+       $sql = "select id,type,subtype,action_type,access_id,view,subject_guid,object_guid,annotation_id,posted" .
+                       " from {$CONFIG->dbprefix}river where {$whereclause} order by posted desc limit {$offset},{$limit}";
 
        // Get data
        return get_data($sql);
@@ -254,7 +257,9 @@ function elgg_view_river_item($item) {
  *
  * @param int|array $subject_guid Acting entity to restrict to. Default: all
  * @param int|array $object_guid Entity being acted on to restrict to. Default: all
- * @param string $subject_relationship If set to a relationship type, this will use $subject_guid as the starting point and set the subjects to be all users this entity has this relationship with (eg 'friend'). Default: blank
+ * @param string $subject_relationship If set to a relationship type, this will use 
+ *     $subject_guid as the starting point and set the subjects to be all users this 
+ *     entity has this relationship with (eg 'friend'). Default: blank
  * @param string $type The type of entity to restrict to. Default: all
  * @param string $subtype The subtype of entity to restrict to. Default: all
  * @param string $action_type The type of river action to restrict to. Default: all
@@ -272,12 +277,12 @@ function elgg_view_river_items($subject_guid = 0, $object_guid = 0, $subject_rel
        // Get river items, if they exist
        if ($riveritems = get_river_items($subject_guid,$object_guid,$subject_relationship,$type,$subtype,$action_type,($limit + 1),$offset,$posted_min,$posted_max)) {
 
-       return elgg_view('river/item/list',array(
-               'limit' => $limit,
-               'offset' => $offset,
-               'items' => $riveritems,
-               'pagination' => $pagination
-       ));
+               return elgg_view('river/item/list',array(
+                       'limit' => $limit,
+                       'offset' => $offset,
+                       'items' => $riveritems,
+                       'pagination' => $pagination
+               ));
 
        }
 
index ce6e7b7a144939fa7c20fd766cc88cb0c493a341..dd5d43592023de1d32296100bfc9e4b13d9eba3d 100644 (file)
@@ -357,6 +357,7 @@ CREATE TABLE `prefix_system_log` (
        `view` TEXT NOT NULL ,\r
        `subject_guid` INT NOT NULL ,\r
        `object_guid` INT NOT NULL ,\r
+       `annotation_id` int(11) NOT NULL,\r
        `posted` INT NOT NULL ,\r
        PRIMARY KEY ( `id` ) ,\r
        KEY `type` (`type`),\r
@@ -364,5 +365,6 @@ CREATE TABLE `prefix_system_log` (
        KEY `access_id` (`access_id`),\r
        KEY `subject_guid` (`subject_guid`),\r
        KEY `object_guid` (`object_guid`),\r
+       KEY `annotation_id` (`annotation_id`),\r
        KEY `posted` (`posted`)\r
 ) ENGINE = MYISAM DEFAULT CHARSET=utf8;
index 7182c7f7672b9ef4440e15e9a1835f6c39c8da46..074d042c32140f224e725437cad6a1b67247d9e4 100644 (file)
@@ -1,2 +1,3 @@
 -- add an additional column to the river table\r
-ALTER TABLE `prefix_river` ADD COLUMN `annotation_id` int(11) NOT NULL AFTER `posted`;
\ No newline at end of file
+ALTER TABLE `prefix_river` ADD COLUMN `annotation_id` int(11) NOT NULL AFTER `object_guid`;\r
+ALTER TABLE `prefix_river` ADD KEY `annotation_id` (`annotation_id`);
\ No newline at end of file