mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 12:28:59 +08:00
ce78eff888
According to the [Rails Source](https://github.com/rails/rails/blob/master/activerecord/lib/active_record/railties/databases.rake#L20) the `ActiveRecord::Migrator.migrations_paths` are overwritten with the value of `ActiveRecord::Tasks::DatabaseTasks.migrations_paths` every time the config is loaded. This caused a bug for Discourse development where if you ran: `rake db:drop db:create db:migrate` in one line, you would not get our post migrations, as those had a custom value for `migrations_paths`. The fix is to use `ActiveRecord::Tasks::DatabaseTasks.migrations_paths` to set up all our custom paths. Everything seems to work as expected.
8 lines
204 B
Ruby
8 lines
204 B
Ruby
# frozen_string_literal: true
|
|
|
|
unless Discourse.skip_post_deployment_migrations?
|
|
ActiveRecord::Tasks::DatabaseTasks.migrations_paths << Rails.root.join(
|
|
Discourse::DB_POST_MIGRATE_PATH
|
|
).to_s
|
|
end
|