-
-
Notifications
You must be signed in to change notification settings - Fork 886
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New parameter
read_only
for /api/v3/post/list (#5264)
* added option to get only read only posts with unittests * formatted code * added index on (person_id, read) on post actions where read is not null * formatted sql * Update migrations/2024-12-15-151642_add_index_on_person_id_read_for_read_only_post_actions/up.sql Co-authored-by: dullbananas <[email protected]> * Fixxed error in down.sql for migration of index on (person_id,read_only,post_id) on post_actions * Fixxed error in unittests * Update crates/db_views/src/post_view.rs Co-authored-by: dullbananas <[email protected]> --------- Co-authored-by: dullbananas <[email protected]>
- Loading branch information
1 parent
c656465
commit ba779b9
Showing
5 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
migrations/2024-12-15-151642_add_index_on_person_id_read_for_read_only_post_actions/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
DROP INDEX idx_post_actions_on_read_read_not_null; | ||
|
4 changes: 4 additions & 0 deletions
4
migrations/2024-12-15-151642_add_index_on_person_id_read_for_read_only_post_actions/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
CREATE INDEX idx_post_actions_on_read_read_not_null ON post_actions (person_id, read, post_id) | ||
WHERE | ||
read IS NOT NULL; | ||
|