]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Notice.php
Squashed commit of the following:
[quix0rs-gnu-social.git] / classes / Notice.php
index a38f54f050cc46337194d74915bdc4f3e81a2e71..9ee5696e3f47a3cb68a8ccb79ca3422edcaccae4 100644 (file)
@@ -87,7 +87,7 @@ class Notice extends Managed_DataObject
 
     public static function schemaDef()
     {
-        return array(
+        $def = array(
             'fields' => array(
                 'id' => array('type' => 'serial', 'not null' => true, 'description' => 'unique identifier'),
                 'profile_id' => array('type' => 'int', 'not null' => true, 'description' => 'who made the update'),
@@ -122,13 +122,19 @@ class Notice extends Managed_DataObject
                 'notice_repeat_of_fkey' => array('notice', array('repeat_of' => 'id')), # @fixme: what about repeats of deleted notices?
             ),
             'indexes' => array(
+                'notice_created_id_is_local_idx' => array('created', 'id', 'is_local'),
                 'notice_profile_id_idx' => array('profile_id', 'created', 'id'),
-                'notice_conversation_idx' => array('conversation'),
-                'notice_created_idx' => array('created'),
-                'notice_replyto_idx' => array('reply_to'),
-                'notice_repeatof_idx' => array('repeat_of'),
+                'notice_repeat_of_created_id_idx' => array('repeat_of', 'created', 'id'),
+                'notice_conversation_created_id_idx' => array('conversation', 'created', 'id'),
+                'notice_replyto_idx' => array('reply_to')
             )
         );
+
+        if (common_config('search', 'type') == 'fulltext') {
+            $def['fulltext indexes'] = array('content' => array('content'));
+        }
+
+        return $def;
     }
     
        function multiGet($kc, $kvs, $skipNulls=true)
@@ -501,7 +507,7 @@ class Notice extends Managed_DataObject
         if (empty($verb)) {
             if (!empty($notice->repeat_of)) {
                 $notice->verb        = ActivityVerb::SHARE;
-                $notice->object_type = ActivityVerb::ACTIVITY;
+                $notice->object_type = ActivityObject::ACTIVITY;
             } else {
                 $notice->verb        = ActivityVerb::POST;
             }