mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 21:53:49 +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)` |
||
---|---|---|
.. | ||
fixtures | ||
migrate | ||
post_migrate | ||
api_test_seeds.rb |