discourse/db/post_migrate
Ted Johansson 9655bf3e24
DEV: Delete upload references on draft cleanup (#26877)
In #22851 we added a dependent strategy for deleting upload references when a draft is destroyed. This, however, didn't catch all cases, because we still have some code that issues DELETE drafts queries directly to the database. Specifically in the weekly cleanup job handled by Draft#cleanup!.

This PR fixes that by turning the raw query into an ActiveRecord #destroy_all, which will invoke the dependent strategy that ultimately deletes the upload references. It also includes a post migration to clear orphaned upload references that are already in the database.
2024-05-06 14:08:10 +08:00
..
20230823095931_add_limit_to_user_second_factor_name.rb SECURITY: Limit name field length of TOTP authenticators and security keys 2023-09-12 15:31:17 -03:00
20230823100627_add_limit_to_user_security_key_name.rb SECURITY: Limit name field length of TOTP authenticators and security keys 2023-09-12 15:31:17 -03:00
20230926165821_drop_post_uploads_table.rb DEV: Drop post_uploads table (#23673) 2023-09-27 12:43:19 +01:00
20231120190818_trigger_post_rebake_category_style_quotes.rb PERF: avoid table scan while performing a very large update (#24525) 2023-11-23 18:15:40 +11:00
20231127165331_trigger_auto_linking_for_videos_since_placeholder.rb DEV: Auto link video placeholder posts (#24576) 2023-11-27 13:22:42 -07:00
20240108022138_change_enable_admin_sidebar_to_group_post_migration.rb FIX: Incorrect admin sidebar setting migration (#25192) 2024-01-10 07:24:23 +10:00
20240110040813_fill_skip_review_media_groups_based_on_deprecated_setting.rb DEV: Convert review_media_unless_trust_level to group-based setting (#25201) 2024-01-11 13:43:01 +10:00
20240112043325_fill_embedded_media_post_allowed_groups_based_on_deprecated_setting.rb DEV: resolve on conflict (#25847) 2024-02-26 10:03:51 -08:00
20240202052058_drop_badge_image_column.rb DEV: Drop deprecated Badge#image column (#25536) 2024-02-02 14:09:55 +08:00
20240212034010_drop_deprecated_columns.rb DEV: Drop deprecated columns (#25640) 2024-02-12 19:35:14 +08:00
20240506035024_clear_orphaned_draft_upload_references.rb DEV: Delete upload references on draft cleanup (#26877) 2024-05-06 14:08:10 +08:00