lemmy/migrations
Nutomic e9e76549a8
Split activity table into sent and received parts (fixes #3103) (#3583)
* Split activity table into sent and received parts (fixes #3103)

The received activities are only stored in order to avoid processing
the same incoming activity multiple times. For this purpose it is
completely unnecessary to store the data. So we can split the
table into sent_activity and received_activity parts, where
only sent_activity table needs to store activity data. This should
reduce storage use significantly.

Also reduces activity storage duration to three months, we can reduce
this further if necessary.

Additionally the id columns of activity tables are removed because
they are completely unused and risk overflowing (fixes #3560).

* address review

* move insert_received_activity() methods to verify handlers

* remove unnecessary conflict line

* clippy

* use on conflict, add tests
2023-07-14 11:17:06 -04:00
..
00000000000000_diesel_initial_setup Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2019-02-26-002946_create_user Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2019-02-27-170003_create_community Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2019-03-03-163336_create_post Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2019-03-05-233828_create_comment Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2019-03-30-212058_create_post_view Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2019-04-03-155205_create_community_view Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2019-04-03-155309_create_comment_view Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2019-04-07-003142_create_moderation_logs Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2019-04-08-015947_create_user_view Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2019-04-11-144915_create_mod_views Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2019-04-29-175834_add_delete_columns Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2019-05-02-051656_community_view_hot_rank Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2019-06-01-222649_remove_admin Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2019-08-11-000918_add_nsfw_columns Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2019-08-29-040006_add_community_count Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2019-09-05-230317_add_mod_ban_views Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2019-09-09-042010_add_stickied_posts Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2019-10-15-181630_add_themes Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2019-10-19-052737_create_user_mention Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2019-10-21-011237_add_default_sorts Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2019-10-24-002614_create_password_reset_request Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2019-12-09-060754_add_lang Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2019-12-11-181820_add_site_fields Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2019-12-29-164820_add_avatar Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-01-01-200418_add_email_to_user_view Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-01-02-172755_add_show_avatar_and_email_notifications_to_user Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-01-11-012452_add_indexes Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-01-13-025151_create_materialized_views Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-01-21-001001_create_private_message Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-01-29-011901_create_reply_materialized_view Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-01-29-030825_create_user_mention_materialized_view Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-02-02-004806_add_case_insensitive_usernames Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-02-06-165953_change_post_title_length Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-02-07-210055_add_comment_subscribed Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-02-08-145624_add_post_newest_activity_time Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-03-06-202329_add_post_iframely_data Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-03-26-192410_add_activitypub_tables Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-04-03-194936_add_activitypub_for_posts_and_comments Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-04-07-135912_add_user_community_apub_constraints Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-04-14-163701_update_views_for_activitypub Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-04-21-123957_remove_unique_user_constraints Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-05-05-210233_add_activitypub_for_private_messages Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-06-30-135809_remove_mat_views Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-07-08-202609_add_creator_published Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-07-12-100442_add_post_title_to_comments_view Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-07-18-234519_add_unique_community_user_actor_ids Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-08-03-000110_add_preferred_usernames_banners_and_icons Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-08-06-205355_update_community_post_count Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-08-25-132005_add_unique_ap_ids Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00
2020-09-07-231141_add_migration_utils Merge branch 'add-view-helper-functions' of https://github.com/eiknat/lemmy into eiknat-add-view-helper-functions 2020-09-23 16:16:18 -05:00
2020-10-07-234221_fix_fast_triggers Adding no conflict triggers. Fixes #1179 2020-10-07 19:05:46 -05:00
2020-10-10-035723_fix_fast_triggers_2 Fixing hot_rank_active fast triggers. Fixes #1190 2020-10-09 23:03:38 -05:00
2020-10-13-212240_create_report_tables update/fix migration, add some doc 2020-11-11 15:11:52 -05:00
2020-10-23-115011_activity_ap_id_column Add /activities endpoint (ref #1220) 2020-10-26 12:54:27 +01:00
2020-11-05-152724_activity_remove_user_id In activity table, remove `user_id` and add `sensitive` (#127) 2020-11-06 13:06:47 +00:00
2020-11-10-150835_community_follower_pending Add pending status for federated follows 2020-11-10 16:45:10 +01:00
2020-11-26-134531_delete_user Better account deletion (fixes #730) (#143) 2020-11-27 21:00:18 +00:00
2020-12-02-152437_create_site_aggregates Report only local counts in site_view. 2021-01-14 15:22:07 -05:00
2020-12-03-035643_create_user_aggregates Adding tests for current aggregates. 2020-12-09 11:52:10 -05:00
2020-12-04-183345_create_community_aggregates Halfway done with hot rank indexes. 2021-01-05 23:42:48 -05:00
2020-12-10-152350_create_post_aggregates Fixing comment count necro-bump issue. 2021-01-15 11:58:56 -05:00
2020-12-14-020038_create_comment_aggregates Halfway done with hot rank indexes. 2021-01-05 23:42:48 -05:00
2020-12-17-030456_create_alias_views Removing fast tables and old views. 2020-12-16 22:42:25 -05:00
2020-12-17-031053_remove_fast_tables_and_views Dropping the unecessary views and table triggers. 2020-12-17 15:29:10 -05:00
2021-01-05-200932_add_hot_rank_indexes Adding stickied to post_aggregates. 2021-01-07 16:22:17 -05:00
2021-01-26-173850_default_actor_id Use Url type for ap_id fields in database (fixes #1364) (#1371) 2021-01-27 11:42:23 -05:00
2021-01-27-202728_active_users_monthly Adding some recurring lemmy tasks. (#1386) 2021-01-29 11:38:27 -05:00
2021-01-31-050334_add_forum_sort_index Adding forum sort for post_aggregates. Fixes #1312 (#1400) 2021-02-01 11:53:44 -05:00
2021-02-02-153240_apub_columns Store activitypub endpoints in database (#162) 2021-02-04 16:34:58 +00:00
2021-02-10-164051_add_new_comments_sort_index Adding a new comment sort for posts. Fixes #1294 (#1425) 2021-02-18 10:38:25 -05:00
2021-02-13-210612_set_correct_aggregates_time_columns Fix aggregates time columns 2 (#1427) 2021-02-18 10:53:04 -05:00
2021-02-25-112959_remove-categories In remove categories down migration, add default for category 2021-02-25 16:16:02 +01:00
2021-02-28-162616_clean_empty_post_urls Use URL type in most outstanding struct fields (#1468) 2021-03-02 12:41:48 +00:00
2021-03-04-040229_clean_icon_urls Fixing wrong user_ and community icon and banner urls. 2021-03-03 23:40:00 -05:00
2021-03-09-171136_split_user_table_2 ~80% done 2021-03-10 17:33:55 -05:00
2021-03-19-014144_add_col_local_user_validator_time Merge branch 'Mart-Bogdan-1462-jwt-revocation-on-pwd-change' into jwt_revocation_dess 2021-03-19 00:31:49 -04:00
2021-03-20-185321_move_matrix_id_to_person Moving admin to person table. Fixes #1515 2021-03-22 10:28:00 -04:00
2021-03-31-103917_add_show_score_setting Adding a setting to show / hide scores. Fixes #1503 2021-03-31 06:54:46 -04:00
2021-03-31-105915_add_bot_account Mark accounts as bot nutomic (#1565) 2021-04-21 17:41:14 -04:00
2021-03-31-144349_add_site_short_description Adding a short site description. Fixes #1496 (#1532) 2021-04-07 11:40:35 +00:00
2021-04-01-173552_rename_preferred_username_to_display_name Changing preferred to display name. Fixes #1211 2021-04-01 13:57:45 -04:00
2021-04-01-181826_add_community_agg_active_monthly_index Adding users active monthly for community sort. Fixes #1527 2021-04-01 14:34:27 -04:00
2021-04-02-021422_remove_community_creator Removing community.creator column. Fixes #1504 (#1541) 2021-04-08 11:29:08 +00:00
2021-04-20-155001_limit-admins-create-community Add option to limit community creation to admins only (fixes #1586) (#1587) 2021-04-22 19:42:58 -04:00
2021-04-24-174047_add_show_read_post_setting Add show_read_posts filter. Fixes #1561 2021-04-24 18:26:50 -04:00
2021-07-19-130929_add_show_new_post_notifs_setting Add show_new_posts_notifs setting. Fixes #1664 (#1665) 2021-07-22 20:07:40 +00:00
2021-07-20-102033_actor_name_length Actor name length config dess (#1672) 2021-07-22 21:53:44 -04:00
2021-08-02-002342_comment_count_fixes Some comment count fixes. 2021-08-01 21:07:45 -04:00
2021-08-04-223559_create_user_community_block User / community blocking. Fixes #426 (#1604) 2021-08-19 20:54:15 +00:00
2021-08-16-004209_fix_remove_bots_from_aggregates Make sure bots aren't included in aggregate counts (#1705) 2021-08-16 20:52:24 +00:00
2021-08-17-210508_create_mod_transfer_community Adding ModTransferCommunity to modlog in API. Fixes #1437 2021-08-17 17:52:28 -04:00
2021-09-20-112945_jwt-secret Move jwt secret from config to database (fixes #1728) 2021-09-27 11:25:09 +02:00
2021-10-01-141650_create_admin_purge Adding admin purging of DB items and pictures. #904 #1331 (#1809) 2022-06-13 19:15:04 +00:00
2021-11-22-135324_add_activity_ap_id_index Fix API dupes query. #1878 2021-11-23 14:30:16 -05:00
2021-11-22-143904_add_required_public_key Making public key required. Fixes #1934 2021-11-22 10:10:18 -05:00
2021-11-23-031528_add_report_published_index Fixing duped report view for admins. Fixes #1933 (#1945) 2021-11-23 15:54:30 +00:00
2021-11-23-132840_email_verification First pass at invite-only migration. (#1949) 2021-12-15 14:49:59 -05:00
2021-11-23-153753_add_invite_only_columns First pass at invite-only migration. (#1949) 2021-12-15 14:49:59 -05:00
2021-12-09-225529_add_published_to_email_verification First pass at invite-only migration. (#1949) 2021-12-15 14:49:59 -05:00
2021-12-14-181537_add_temporary_bans Adding temporary bans. Fixes #1423 (#1999) 2022-01-08 12:37:07 +00:00
2022-01-04-034553_add_hidden_column Hide community v2 (#2055) 2022-02-18 02:30:47 +00:00
2022-01-20-160328_remove_site_creator Removing the site creator, adding leave_admin. Fixes #1808 (#2052) 2022-01-26 17:57:16 +00:00
2022-01-28-104106_instance-actor Implement instance actor (#1798) 2022-02-07 19:23:12 +00:00
2022-02-01-154240_add_community_title_index Alpha-ordering community follows. Fixes #2062 (#2079) 2022-02-01 20:00:54 +00:00
2022-02-18-210946_default_theme Add site option for default theme (#2104) 2022-02-23 11:40:36 -05:00
2022-04-04-183652_update_community_aggregates_on_soft_delete Update community statistics after post or comment is deleted by user (#2193) 2022-04-27 16:12:41 +00:00
2022-04-11-210137_fix_unique_changeme Fixing generate unique changeme (#2205) 2022-04-13 11:13:29 +00:00
2022-04-12-114352_default_post_listing_type Add default post listing type (fixes #2195) (#2209) 2022-04-19 19:05:08 +00:00
2022-04-12-185205_change_default_listing_type_to_local Changing default listing type to Local from Subscribed. 2022-04-13 17:35:21 +00:00
2022-04-19-111004_default_require_application Require registration application by default (#2229) 2022-04-19 19:13:20 +00:00
2022-04-26-105145_only_mod_can_post Implement restricted community (only mods can post) (fixes #187) (#2235) 2022-04-28 20:32:32 +00:00
2022-05-19-153931_legal-information Add legal information (fixes #721) (#2273) 2022-05-19 20:32:40 +00:00
2022-05-20-135341_embed-url Embed Peertube videos (#2261) 2022-06-02 21:44:47 +00:00
2022-06-12-012121_add_site_hide_modlog_names Add Modlog Filters (#2313) 2022-08-16 11:52:04 +00:00
2022-06-13-124806_post_report_name_length Fix length of post_report.original_post_name db field (fixes #2311) (#2315) 2022-06-14 01:20:01 -04:00
2022-06-21-123144_language-tags Add language tags for comments 2022-09-02 10:49:54 -04:00
2022-07-07-182650_comment_ltrees Only create ltree postgres extension in migration if doesn't already exist (#3092) 2023-06-14 17:03:10 -04:00
2022-08-04-150644_add_application_email_admins Adding email admins for new applications. Fixes #2271 (#2390) 2022-09-27 12:48:44 -04:00
2022-08-04-214722_add_distinguished_comment Adding distinguish comment. Fixes #2002 (#2391) 2022-08-17 11:38:52 +00:00
2022-08-05-203502_add_person_post_aggregates Showing # of unread comments for posts. Fixes #2134 (#2393) 2022-09-27 16:45:46 +00:00
2022-08-22-193848_comment-language-tags Add language tags for comments 2022-09-02 10:49:54 -04:00
2022-09-07-113813_drop_ccnew_indexes_function Adding job to drop phantom ccnew indexes. Fixes #2431 (#2432) 2022-09-07 12:12:51 +00:00
2022-09-07-114618_pm-reports Implement reports for private messages (#2433) 2022-09-19 22:58:42 +00:00
2022-09-08-102358_site-and-community-languages implement language tags for site/community in db and api (#2434) 2022-10-06 14:27:58 -04:00
2022-09-24-161829_remove_table_aliases Diesel 2.0.0 upgrade (#2452) 2022-09-26 14:09:32 +00:00
2022-10-06-183632_move_blocklist_to_db Moving settings to Database. (#2492) 2022-10-27 09:24:07 +00:00
2022-11-13-181529_create_taglines Add support for Taglines (#2548) 2022-11-19 09:48:29 -05:00
2022-11-20-032430_sticky_local Add support for Featured Posts (#2585) 2022-12-12 11:17:10 +00:00
2022-11-21-143249_remove-federation-settings Remove federation settings, rely on sensible defaults instead (#2574) 2022-11-21 11:44:34 -05:00
2022-11-21-204256_user-following Implement federated user following (fixes #752) (#2577) 2022-11-23 18:40:47 -05:00
2022-12-05-110642_registration_mode Use enum for registration mode setting (#2604) 2023-01-05 01:42:30 +00:00
2023-01-17-165819_cleanup_post_aggregates_indexes Update post_aggregates indexes to account for featured_local and featured_community columns. (#2661) 2023-01-20 12:44:03 -05:00
2023-02-01-012747_fix_active_index Fixing GetPosts active sort index. Fixes #2683 (#2684) 2023-02-02 14:09:32 -05:00
2023-02-05-102549_drop-site-federation-debug Activitypub breaking changes for Lemmy 0.18 (#2705) 2023-06-07 15:18:17 -04:00
2023-02-07-030958_community-collections Implement separate mod activities for feature, lock post (#2716) 2023-02-18 09:50:28 -05:00
2023-02-11-173347_custom_emojis Add Custom Emojis Support (#2616) 2023-03-20 17:32:31 -04:00
2023-02-13-172528_add_report_email_admins Adding a site option to email admins for new reports. (#2730) 2023-02-15 00:57:08 +09:00
2023-02-13-221303_add_instance_software_and_version Adding instance software and version. Fixes #2222 (#2733) 2023-02-18 09:36:12 -05:00
2023-02-15-212546_add_post_comment_saved_indexes Fixing slow joins to post_read, post_saved, and comment_saved . (#2738) 2023-02-18 09:35:35 -05:00
2023-02-16-194139_add_totp_secret Adding TOTP / 2FA to lemmy (#2741) 2023-03-02 21:37:41 +01:00
2023-04-14-175955_add_listingtype_sorttype_enums Adding diesel enums for SortType and ListingType (#2808) 2023-04-17 15:19:51 -04:00
2023-04-23-164732_add_person_details_indexes Addressing slow profile queries. #2777 (#2830) 2023-04-25 19:28:06 -04:00
2023-05-10-095739_force_enable_undetermined_language Force enable undetermined language (#2851) 2023-05-18 16:34:21 +02:00
2023-06-06-104440_index_post_url Adding hot_rank columns in place of function sorting. (#2952) 2023-06-08 16:15:15 -04:00
2023-06-07-105918_add_hot_rank_columns Adding hot_rank columns in place of function sorting. (#2952) 2023-06-08 16:15:15 -04:00
2023-06-17-175955_add_listingtype_sorttype_hour_enums Feature add hours as sorting options backend (#3161) 2023-06-20 16:05:43 +02:00
2023-06-19-055530_add_retry_worker_setting Remove `actix_rt` & use standard tokio spawn (#3158) 2023-06-26 10:24:11 +02:00
2023-06-19-120700_no_double_deletion Do not decrement comment score twice when removing then deleting. (#3196) 2023-07-03 14:13:53 -04:00
2023-06-20-191145_add_listingtype_sorttype_3_6_9_months_enums Fix missing sorting types (#3370) 2023-06-28 12:44:16 -04:00
2023-06-21-153242_add_captcha feat: re-added captcha checks (#3289) 2023-06-27 06:38:53 -04:00
2023-06-22-051755_fix_local_communities_marked_non_local Add migration to mark local communities as such (#3257) 2023-06-22 07:52:31 -04:00
2023-06-22-101245_increase_user_theme_column_size Update DB local_user.theme type to text (#3266) 2023-06-26 10:53:04 +02:00
2023-06-24-072904_add_open_links_in_new_tab_setting Add Open links in new tab setting (#3318) 2023-07-03 11:10:25 -04:00
2023-06-24-185942_aggegates_published_indexes Batch hot rank updates (#3175) 2023-06-27 10:13:51 +02:00
2023-07-04-153335_add_optimized_indexes improve admin and mod check to not do seq scans and return unnecessary data (#3483) 2023-07-06 14:44:26 +02:00
2023-07-05-000058_person-admin improve admin and mod check to not do seq scans and return unnecessary data (#3483) 2023-07-06 14:44:26 +02:00
2023-07-06-151124_hot-rank-future Make hot rank not crash on future (#3517) 2023-07-07 11:27:47 +02:00
2023-07-08-101154_fix_soft_delete_aggregates Fix #3501 - Fix aggregation counts for elements removed and deleted (#3543) 2023-07-10 11:30:30 -04:00
2023-07-10-075550_add-infinite-scroll-setting Add infinite scroll user option (#3572) 2023-07-12 09:12:01 -04:00
2023-07-11-084714_receive_activity_table Split activity table into sent and received parts (fixes #3103) (#3583) 2023-07-14 11:17:06 -04:00
.gitkeep Isomorphic docker (#1124) 2020-09-15 15:26:47 -04:00