discourse/db/post_migrate
Martin Brennan 8040b95e8c
DEV: Re-add polymorphic bookmark columns (#16261)
This commit is a redo of2f1ddadff7dd47f824070c8a3f633f00a27aacde
which we reverted because it blew up an internal CI check. I looked
into it, and it happened because the old migration to add the bookmark
columns still existed, and those columns were dropped in a post migrate,
so the two migrations to add the columns were conflicting before
the post migrate was run.

------

This commit only includes the creation of the new columns and index,
and does not add any triggers, backfilling, or new data.

A backfill will be done in the final PR when we switch this over.
Intermediate PRs will look something like this:

Add an experimental site setting for using polymorphic bookmarks,
and make sure in the places where bookmarks are created or updated
we fill in the columns. This setting will be used in subsequent
PRs as well.
Listing and searching bookmarks based on polymorphic associations
Creating post and topic bookmarks using polymorphic associations,
and changing special for_topic logic to just rely on the Topic
bookmarkable_type
Querying bookmark reminders based on polymorphic associations
Make sure various other areas like importers, bookmark guardian,
and others all rely on the associations
Prepare plugins that rely on the Bookmark model to use polymorphic
associations
The final core PR will remove all the setting gates and switch over
to using the polymorphic associations, backfill the bookmarks
table columns, and ignore the old post_id and for_topic colummns.
Then it will just be a matter of dropping the old columns down the
line.
2022-03-23 12:43:08 +10:00
..
20210125100452_migrate_search_data_after_default_locale_rename.rb FIX: move post_search_data migration into onceoff job (#11851) 2021-01-26 16:29:00 +01:00
20210127140730_undo_add_processed_to_notifications.rb DEV: Replace 'processed' column on notifications with new table (#11864) 2021-01-27 10:29:24 -06:00
20210207232853_fix_topic_timer_duration_minutes.rb FIX: Delete topic timers far in the future (#12125) 2021-02-18 14:18:43 +02:00
20210215231312_fix_group_flair_avatar_upload_security_and_acls.rb FIX: Do not mark group_flair images as secure on upload (#12081) 2021-02-16 12:34:03 +10:00
20210218022739_move_new_since_to_new_table_again.rb FIX: ensure corrected migration runs (#12137) 2021-02-19 11:48:32 +11:00
20210219171329_drop_old_sso_site_settings.rb DEV: Drop old SSO site setting rows from the database (#12148) 2021-02-19 19:05:49 +00:00
20210302164429_drop_flash_onebox_site_setting.rb Drop flash video onebox (#12261) 2021-03-02 17:11:14 +00:00
20210324043327_delete_orphan_post_revisions.rb FIX: delete orphan post revisions (#12502) 2021-03-25 12:34:53 +11:00
20210328233843_fix_bookmarks_with_incorrect_topic_id.rb FIX: Bookmark topics were not being updated when the post moved (#12542) 2021-03-29 11:25:48 +10:00
20210513125608_remove_length_constrain_from_topic_excerpt.rb FIX: errors that're triggering by too long excerpts (#13056) 2021-05-31 14:59:40 +04:00
20210525112226_remove_length_constrain_from_topic_link_url.rb FIX: PG::StringDataRightTruncation when linking posts (#13134) 2021-06-02 15:27:04 +04:00
20210528003603_fix_badge_image_avatar_upload_security_and_acls.rb FIX: Do not mark badge image uploads as secure (#13193) 2021-05-28 12:35:52 +10:00
20210621234939_backfill_email_log_topic_id.rb PERF: optimise backfilling of topic_id (#13545) 2021-06-28 16:16:22 +10:00
20210624023831_remove_highest_seen_post_number_from_topic_users.rb FEATURE: Add last visit indication to topic view page. (#13471) 2021-07-05 14:17:31 +08:00
20210628035905_drop_duration_column_from_topic_timers.rb DEV: Drop duration column from topic timers (#13543) 2021-06-29 09:27:12 +10:00
20210706091905_drop_disable_jump_reply_column_from_user_options.rb DEV: Drop user_options.disable_jump_reply column (#13646) 2021-07-06 10:47:17 +01:00
20210709053030_drop_uploads_verified.rb DEV: Drop uploads verified column (#13677) 2021-07-09 16:16:13 +10:00
20210802131421_remove_post_processed_trigger_option.rb DEV: Remove PostProcessed trigger option (#13916) 2021-08-04 22:24:47 +02:00
20210909041448_make_topic_id_nullable_for_bookmarks.rb DEV: Ignore bookmarks.topic_id column and remove references to it in code (#14289) 2021-09-15 10:16:54 +10:00
20210922064213_alter_bumped_at_indexes_on_topics.rb PERF: Improve database query perf when loading topics for a category. (#14416) 2021-09-28 10:05:00 +08:00
20211019152356_populate_pending_posts_count_column.rb FEATURE: Display pending posts on user’s page 2021-11-29 10:26:33 +01:00
20211124161346_queue_internal_onebox_rebake.rb FIX: Use CDN URL for internal onebox avatars (#15077) 2021-11-25 12:07:34 +00:00
20211201221028_migrate_email_to_normalized_email.rb PERF: migrate normalized_emails in a migrations (#15166) 2021-12-02 15:08:22 +11:00
20211206160212_drop_token_from_email_tokens.rb DEV: Drop unused column email_tokens.token (#15203) 2021-12-13 16:29:47 +11:00
20211224010204_drop_old_bookmark_columns.rb DEV: Drop old bookmark columns (#15405) 2022-01-04 11:19:27 +10:00
20220202223955_migrate_selectable_avatars_enabled.rb FEATURE: upload an avatar option for uploading avatars with selectable avatars (#15878) 2022-02-24 12:57:39 -08:00
20220214224506_reset_custom_emoji_post_bakes_version_secure_fix.rb DEV: Remove use of Discourse application code in migration. (#16068) 2022-02-28 10:48:46 +08:00
20220215015538_drop_user_stat_count_constraints.rb DEV: Drop user_stats count column constraints (#15949) 2022-02-16 12:49:11 +11:00
20220220234155_conform_bounce_error_code.rb DEV: Fix SMTP bounce regexp (#16019) 2022-02-22 08:54:01 +10:00
20220302171443_rebake_old_avatar_service_urls.rb FIX: Update and rebake uses of the old centralized avatar service (#16086) 2022-03-07 09:45:20 +00:00