* [0.19] Fixing active counts slow queries. (#5907)
* Fixing active counts slow queries.
* Simplify back to str tuple
* Batch site and community updates
* Using update from temp table
* Making aggs temp table use interval name.
* Make dev setup use optimized postgres.
* Addressing PR comments.
* Use ref
* Removing system custom info from customPostgresql.conf
* Forgot to remove old scheduled tasks.
* Making sure migrations aren't missing anything from release/v0.19
Checked using git diff --diff-filter D --stat release/v0.19 migrations
* Rename all migrations to come after release/v0.19 migrations
* Add liked_at is not null check.
* Adding a local_site and local_user setting for default fetch limit
- Currently only used for list_posts and list_comments, like the other
defaults.
- Fixes#5474
* Addressing PR comments.
* Finishing up post and comment actions
* Adding community_actions.
* instance and person actions
* Fixing person_actions.
* Fixing down migrations
* Adding person_content_combined.
* Search combined.
* Aggregates tables.
* Dont rename old tables
* Fixing some constraints.
* Convert bigints to ints
* Forgot a bigint.
* Rest of i64 -> i32
* Adding actions id columns.
* Fixing connection config.
* Formatting smoosh up.sql
* Use current_date instead of now
* Adding history tables for liked_combined
* Upping wal size
* Fix clippy
* Fixing clippy.
* Fixing i64
* Getting rid of let mut conn
* Adding the history status table.
* Adding published indexes to speed up history.
* Adding comment like history scanning.
* Fixing schema options setup.
* post_read history
* person_post_aggregates / read_comments history
* post_like history
* Fixing conflicts.
* Fixing clippy.
* Use constant batch_size.
* person content combined post and comment history.
* Fixing id scanning.
* post/comment_actions -> saved_combined history
* search history
* Post and comment aggregates -> post / comment history.
* Uncommenting full history building.
* Changing DB_BATCH_SIZE to i64
* Fixing clippy.
* Fix index names.
* Fixing diff check by removing indexes.
* Adding the uplete ignore actions::id columns.
* Fixing merge imports.
* Fixing submodule update
* Try trigger disabling.
* Fix clippy
* Remove history table, do faster bulk inserts. Smoosh first.
Comments about how this fast insert is done is within smoosh comments.
* Adding some timings.
* Fast person content combined history
* Adding search_combined
* Fix person saved combined unique names
* person_liked_combined
* Remove-aggregates
* Fixing up.sql issues
* Re-building schema.rs
* Fixing down migrations.
* Removing history updating.
* Format sql.
* Move postgres logging to customPostgresql.conf
* Try using postgres 16-alpine in CI
* Speeding up add_report_count.
* speed up inbox_combined
* Speeding up remove_post_sort_type_enums
* Fixing post_sort_type
* Speeding up person votes
* Fixing wrong conn.
* Fixing broken migrations
* Remove comment.
* Make sure to re-index table after re-enabling indexes.
* Removing id columns from actions tables.
* Fixing down migrations.
* Using create table as for smoosh migration
* create_table as for person_content_combined.
* Fixing person_content_combined uniques
* create table as for search_combined
* create table as for liked_combined
* create table as for inbox_combined.
* Fixing a few score types.
* Fixing id positions.
* Add post_actions.disable_notifications (fixes#3042)
* Split up logic for send_local_notifs()
* refactor
* fmt
* add api endpoint, check
* dont call send_local_notifs from comment delete/remove
* move scrape_text_for_mentions() inside send_local_notifs()
* nullable
* simplify
* handle parent notification first
* cleanup
* remove `CommentResponse.recipient_ids`
* post notifications enum
* Follow posts (fixes#3069)
* use references
* cleanup
* new file
* db migration to merge mention, reply tables
* code adjustments
* adjust test code
* adjust enum case
* wip: get rid of inbox_combined table
* add table local_user_notification
* tests compiling
* get rid of inbox_combined, only use notification table
* rename view
* notify private messages
* clippy
* copy existing data
* wip: tests
* move tests
* clippy
* notify post subscribers
* community subscribe
* test fixes
* migration fix
* rename routes
* separate struct for api
* rename api params
* merge migrations
* separate notification modes for post/community
* fix
* down migration copy data
* test fix
* update api tests
* only single notification table
* clippy
* use local user id for recipient
* fix comments
* rename table
* recipient local user
* add indices
* keep local user id
* renames and cleanup
* NotificationDataType
* change notification response
* fix api tests
* test fix
* remove private_message.read
* fixes
* test fix
* fix
* Keep totals of upvotes and downvotes given to each user.
- Adds a `voted_at`, `upvotes` and `downvotes` to person_actions.
- Didn't use triggers, because I couldn't figure out how to get the
voter, and also because it should only be for local users anyway.
- Fixes#2370
* Clippy
* Adding history filling.
* Try to fix postgres alias error 1
* Update crates/db_schema/src/impls/person.rs
Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
* Addressing PR comments
* Removing commented line.
* Fixing type errors.
* Fixing test
* Fixing like score 0 and api test errors.
* Some clippy fixes
* Update migrations/2025-06-14-141408_person_votes/up.sql
Co-authored-by: dullbananas <dull.bananas0@gmail.com>
* Update migrations/2025-06-14-141408_person_votes/up.sql
Co-authored-by: dullbananas <dull.bananas0@gmail.com>
* Update migrations/2025-06-14-141408_person_votes/up.sql
Co-authored-by: dullbananas <dull.bananas0@gmail.com>
* Formatting sql
* Fixing migration.
* Cleaning up merge
---------
Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
Co-authored-by: dullbananas <dull.bananas0@gmail.com>
* Fix migration local_image_person
* Make constraints deferrable (ref #5798)
* Some more adjustments
* fix down migrations
* set not deferrable once done
* fix
---------
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
* some test data in migration tests after initial setup (40 migrations)
* - fixed migration rollbacks creating NOT NULL fields without DEFAULT value
- added couple of checks
* fix sql fmt
* fix sql fmt
* allow indexing and unwrapping in tests
* Implement multi-community (fixes#818, fixes#5340)
* db methods
* add api methods
* ts opt
* wip
* sql queries
* cleanup
* wip: federation
* query by name
* add ap_id column
* add read_apub, compiles now
* validate multi-comm name
* disallow removed, deleted, private
* scheduled task
* remove piefed test
* resolve_object with workaround
* review
* avoid db read
* api client
* fix api test fetch
* wip: test cases
* wip
* add max elements, array_remove comments
* simplify post view query
* mvoe structs
* fix api test
* fix api test
* rename to suggested_communities, add api param
* filter removed/deleted
* check_api_elements_count
* filter out removed/deleted during update
* inner join
* add listing type suggested
* db schema changes
* transaction
* address some review comments
* separate methods for create, delete entry
* update js client
* get multi
* remove CommunityOrMulti
* check helper, other stuff
* fix api test
* change get multi comm return type
* Replace MultiCommunityView with GetMultiCommunityResponse
* get rid of todo
* add local column, admins can edit local multi-comm
* implement multi-comm follow (db and api)
* api for multi-comm follow
* move and rename MultiCommunityApub
* move multi-comm to apub-objects
* move multi-comm url to top-level
* list multi-comms followed by user
* add todo
* remove param
* update local follows
* update query
* db functions and tests
* cleanup
* fix api test
* add entry limit
* rewrite links
* federation changes
* wip federation
* simplify generate_activity_id
* more wip
* more wip
* multi-comm follow
* federate changes
* cleanup
* clippy
* test fixes
* fmt
* fix
* wip: update follows after federated multi-comm change
* remove scheduled task
* update follows after multi update
* fmt
* fixes
* review comments
* indexes
* remove MultiCommunityApub
* fix test
* ts fix
* review
* db schema for local_site.multi_comm_follower
* adjust code and tests
* fixes
* cleanup, comment
* fix tests
* fix
* remove more test code
* fix new install
* add index
* fix api tests
* fix
* remove index
* more fix
* Implement multi-community search (fixes#5778) (#5779)
* Implement multi-community search (fixes#5778)
* fixes
* search title and description
* MultiCommunityView
* rename fields
* revert test change
* Adding ability to make a note for a given person.
- This comes back with PersonActions.note, already on post and comment
views.
- Also adds person_actions to PersonView, so that the read person API
action can return the note.
- Fixes#2353
* Adding unit test for person_view read.
* Fixing bindings check
* Addressing PR comments
* Moving API action to person/note
* Adding migration for renaming timestamps to at
* Running format.
* Updating code to _at
* Fix replaceable schema
* Fixing scheduled tasks.
* Fixing and cleaning up api tests.
* Fixing cargo shear.
* Throw error if the removed code_migrations.rs needed to run but didn't
* support postgresql 15
* improve error message
---------
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
* Migrations before column fixes
* Change local_image to reference person_id, to track thumbnail creators.
- Fixes#5564
* Fixing API tests.
* Increase the post query duration time. #5661
* Adding thumbnail_and_post_id column
* Forgot ts-optional
* Fixing post spec tests.
* Try using promise.allSettled to ignore errors.
* Using consistent pictrs api key.
* Dont fetch thumbnails for user API.
* Dont delete thumbnails for user deletion.
* Dont filter out thumbnail images when fetching or deleting.
* Update crates/api_common/src/utils.rs
Co-authored-by: Richard Schwab <gitrichardschwab-7a2qxq42kj@central-intelligence.agency>
* Addressing PR comments
* Add comment.
* Rename to thumbnail_for_post_id
* Addressing PR comments
---------
Co-authored-by: Richard Schwab <gitrichardschwab-7a2qxq42kj@central-intelligence.agency>
* created new table post_keyword_block related to a person and corresponding functions in diesel
* created corresponding api functions
* converted like to ilike in filter
* Fixxed errors for adding keywords for blocking posts
* Fixxed errors in diesel migrations
* Removed debug print
* #3710: Fixxed errors caused by cargo check
* #3710: added up and down scripts for diesel
* added tmp.schema to gitignore
* updated tests
* fixxed test
* fixxed error from rebasing
* Added max number of block tags and modified max length of block tags
* formatted code
* added migration to restrict block keyword length
* #3710: Added check if Blocked keyword is already existing
* #3710: Removed deprecated any
* #3710: Updated keyword length
* #3710: Fixxed errors from master merge
* #3710: Formatting
* #3710: Removed api to block keywords for post from v3 and changed of api path in v4
* #3710: Renamed post_keyword_block table to user_post_keyword_block and replaced id as primary key with the composed key person_id and keyword. Also now use update function which updates the blocked keywords for an user with a new list instead keyword by keyword.
* #3710: Formatted code
* #3710: Removed unnecessary parts for the block API in post as this will be done over the user settings
* #3710: Modified data structure for blocking keywords to reference local user and added update function which will update at all keywords for a local user at once
* #3710: Modified code so updating blocked keywords is now done over user settings
* #3710: Fixxed merging error
* #3710: Fixxed filter query
* #3710: Formatted Code
* #3710: Added suggested changes from review: keyword block update now does delete and then insert, postview uses read from LocalKeywordBlock, and validation with min_length_check and max_length_check
* #3710: formatted code
* c
* #3710: removed BlockKeywordForPost struct
* #3710: formatted code
* #3710: formatted code
* #3710: formatted code
* Add columns post.pending, comment.pending
* add comments
* rename migration
* helper method, set not pending on vote received
* rename to federation_pending, add comments
* fix down migration