FIX: Rails 6 multisite migrations and plugin migrations
Prior to this change plugin migrations were not working and multisite migrations not working. Rails internals changed so we need to account for it. Specifically semantics of `db:migrate` in rails changed so it is sort of a "multisite:migrate".
This commit is contained in:
parent
aa511c5b59
commit
025d4ee91f
|
@ -516,7 +516,7 @@ class Plugin::Instance
|
|||
Rake.add_rakelib(File.dirname(path) + "/lib/tasks")
|
||||
|
||||
# Automatically include migrations
|
||||
migration_paths = Rails.configuration.paths["db/migrate"]
|
||||
migration_paths = ActiveRecord::Migrator.migrations_paths
|
||||
migration_paths << File.dirname(path) + "/db/migrate"
|
||||
|
||||
unless Discourse.skip_post_deployment_migrations?
|
||||
|
|
|
@ -48,8 +48,16 @@ task 'db:drop' => [:load_config] do |_, args|
|
|||
end
|
||||
end
|
||||
|
||||
begin
|
||||
Rake::Task["db:migrate"].clear
|
||||
end
|
||||
|
||||
# we need to run seed_fu every time we run rake db:migrate
|
||||
task 'db:migrate' => ['environment', 'set_locale'] do |_, args|
|
||||
ActiveRecord::Tasks::DatabaseTasks.migrate
|
||||
|
||||
Rake::Task['db:_dump'].invoke
|
||||
|
||||
SeedFu.seed(DiscoursePluginRegistry.seed_paths)
|
||||
|
||||
unless Discourse.skip_post_deployment_migrations?
|
||||
|
|
Loading…
Reference in New Issue