mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Migration paths were being forgotten
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.
This commit is contained in:
@@ -526,7 +526,7 @@ class Plugin::Instance
|
||||
Rake.add_rakelib(File.dirname(path) + "/lib/tasks")
|
||||
|
||||
# Automatically include migrations
|
||||
migration_paths = ActiveRecord::Migrator.migrations_paths
|
||||
migration_paths = ActiveRecord::Tasks::DatabaseTasks.migrations_paths
|
||||
migration_paths << File.dirname(path) + "/db/migrate"
|
||||
|
||||
unless Discourse.skip_post_deployment_migrations?
|
||||
|
||||
Reference in New Issue
Block a user