You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2022/10/14 17:06:51 UTC

[allura] branch db/mongo_indexes created (now 8b08932b8)

This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a change to branch db/mongo_indexes
in repository https://gitbox.apache.org/repos/asf/allura.git


      at 8b08932b8 add indexes to Post for update_stats() queries

This branch includes the following new commits:

     new d147d5f0a make oauth api_key unique, to match child class that has it unique
     new 8b08932b8 add indexes to Post for update_stats() queries

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[allura] 02/02: add indexes to Post for update_stats() queries

Posted by br...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch db/mongo_indexes
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 8b08932b8f21dd6e9ab743ed7652c5ea5164a7c1
Author: Dave Brondsema <db...@slashdotmedia.com>
AuthorDate: Fri Oct 14 13:06:37 2022 -0400

    add indexes to Post for update_stats() queries
---
 Allura/allura/model/discuss.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Allura/allura/model/discuss.py b/Allura/allura/model/discuss.py
index 49e0e4686..2c40db80f 100644
--- a/Allura/allura/model/discuss.py
+++ b/Allura/allura/model/discuss.py
@@ -512,7 +512,10 @@ class Post(Message, VersionedArtifact, ActivityObject, ReactableArtifact):
         indexes = [
             # used in general lookups, last_post, etc
             ('discussion_id', 'status', 'timestamp'),
-            'thread_id',
+            # for update_stats()
+            ('discussion_id', 'deleted', 'status'),
+            # for update_stats() and thread_id in general
+            ('thread_id', 'status', 'deleted'),
             # for find_posts/query_posts, including full_slug sort which is useful on super big threads
             ('deleted', 'discussion_id', 'thread_id', 'full_slug'),
         ]


[allura] 01/02: make oauth api_key unique, to match child class that has it unique

Posted by br...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch db/mongo_indexes
in repository https://gitbox.apache.org/repos/asf/allura.git

commit d147d5f0a441ddc11d5ca54270c7e8691abf4d7b
Author: Dave Brondsema <db...@slashdotmedia.com>
AuthorDate: Fri Oct 14 13:06:02 2022 -0400

    make oauth api_key unique, to match child class that has it unique
---
 Allura/allura/model/oauth.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Allura/allura/model/oauth.py b/Allura/allura/model/oauth.py
index 69778b434..8060dfce2 100644
--- a/Allura/allura/model/oauth.py
+++ b/Allura/allura/model/oauth.py
@@ -46,7 +46,7 @@ class OAuthToken(MappedClass):
     class __mongometa__:
         session = main_orm_session
         name = 'oauth_token'
-        indexes = ['api_key']
+        unique_indexes = ['api_key']
         polymorphic_on = 'type'
         polymorphic_identity = None