mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 23:13:48 +08:00
14003abc37
Because previous migration was already deployed and some databases were already migrated, I needed to add some conditions to the migration. Previous migration - https://github.com/discourse/discourse/blob/master/db/post_migrate/20200629232159_rename_path_whitelist_to_allowed_paths.rb What will happen in a scenario when previous migration was not run. 1. column allowed_paths will be created 2. allowed_path will be populated with data from path_whitelist 3. path_whitelist column will be dropped What will happen in a scenario when previous migration was already run. 1. column allowed_paths will not be created because already exists - `unless column_exists?(:embeddable_hosts, :allowed_paths)` 2. Data will not be copied because path_whitelist is missing - `if column_exists?(:embeddable_hosts, :path_whitelist) && column_exists?(:embeddable_hosts, :allowed_paths)` 3. path_whitelist column deletion will be skipped - `if column_exists?(:embeddable_hosts, :path_whitelist)` |
||
---|---|---|
.. | ||
20180917024729_remove_superfluous_columns.rb | ||
20180917034056_remove_superfluous_tables.rb | ||
20181012123001_drop_group_locked_trust_level_from_user.rb | ||
20181112013117_migrate_url_site_settings.rb | ||
20190103065652_remove_uploaded_meta_id_from_category.rb | ||
20190121203023_drop_queued_post_id_from_user_actions.rb | ||
20190123171817_drop_queued_posts.rb | ||
20190205104116_drop_unused_auth_tables.rb | ||
20190208144706_drop_unused_auth_tables_again.rb | ||
20190312194528_drop_email_user_options_columns.rb | ||
20190508141824_drop_claimed_by_id.rb | ||
20190716124050_remove_via_email_from_invite.rb | ||
20191107032231_change_notification_level.rb | ||
20191107190330_remove_suppress_from_latest_from_category.rb | ||
20191129144706_drop_unused_google_instagram_auth_tables.rb | ||
20191219112000_remove_key_from_api_keys.rb | ||
20200117174646_make_post_reply_id_column_read_only.rb | ||
20200120131338_drop_unused_columns.rb | ||
20200330233427_drop_old_unread_pm_notification_indices.rb | ||
20200408121312_remove_key_from_user_api_key.rb | ||
20200415140830_drop_automatic_membership_retroactive_from_group.rb | ||
20200424032633_remove_canonical_email_from_user_emails.rb | ||
20200430010528_remove_avg_time_from_topics_posts.rb | ||
20200508141209_allow_null_old_email_on_email_change_requests.rb | ||
20200513185052_drop_topic_reply_count.rb | ||
20200520001619_remove_fks_from_bookmarks.rb | ||
20200522004855_remove_access_control_post_fk.rb | ||
20200601111500_remove_image_url_from_post_and_topic.rb | ||
20200610150900_correct_posts_schema.rb | ||
20200715045152_remove_bookmarks_delete_when_reminder_sent.rb | ||
20200724060632_remove_deprecated_allowlist_settings.rb | ||
20200728004302_drop_path_whitelist_from_embeddable_hosts.rb |