FIX: Don't run seeds if multisite migration fails.
This commit is contained in:
parent
e8328968bb
commit
1d281353b6
|
@ -160,25 +160,7 @@ task 'multisite:migrate' => ['db:load_config', 'environment', 'set_locale'] do |
|
||||||
end.each(&:join)
|
end.each(&:join)
|
||||||
end
|
end
|
||||||
|
|
||||||
execute_concurently(concurrency, exceptions) do |db|
|
def check_exceptions(exceptions)
|
||||||
puts "Migrating #{db}"
|
|
||||||
ActiveRecord::Tasks::DatabaseTasks.migrate
|
|
||||||
end
|
|
||||||
|
|
||||||
SeedFu.seed(SeedHelper.paths, /001_refresh/)
|
|
||||||
|
|
||||||
execute_concurently(concurrency, exceptions) do |db|
|
|
||||||
|
|
||||||
puts "Seeding #{db}"
|
|
||||||
SeedFu.seed(SeedHelper.paths, SeedHelper.filter)
|
|
||||||
|
|
||||||
if !Discourse.skip_post_deployment_migrations? && ENV['SKIP_OPTIMIZE_ICONS'] != '1'
|
|
||||||
SiteIconManager.ensure_optimized!
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
$stdout = old_stdout
|
|
||||||
|
|
||||||
if exceptions.length > 0
|
if exceptions.length > 0
|
||||||
STDERR.puts
|
STDERR.puts
|
||||||
STDERR.puts "-" * 80
|
STDERR.puts "-" * 80
|
||||||
|
@ -193,6 +175,28 @@ task 'multisite:migrate' => ['db:load_config', 'environment', 'set_locale'] do |
|
||||||
end
|
end
|
||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
execute_concurently(concurrency, exceptions) do |db|
|
||||||
|
puts "Migrating #{db}"
|
||||||
|
ActiveRecord::Tasks::DatabaseTasks.migrate
|
||||||
|
end
|
||||||
|
|
||||||
|
check_exceptions(exceptions)
|
||||||
|
|
||||||
|
SeedFu.seed(SeedHelper.paths, /001_refresh/)
|
||||||
|
|
||||||
|
execute_concurently(concurrency, exceptions) do |db|
|
||||||
|
puts "Seeding #{db}"
|
||||||
|
SeedFu.seed(SeedHelper.paths, SeedHelper.filter)
|
||||||
|
|
||||||
|
if !Discourse.skip_post_deployment_migrations? && ENV['SKIP_OPTIMIZE_ICONS'] != '1'
|
||||||
|
SiteIconManager.ensure_optimized!
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
$stdout = old_stdout
|
||||||
|
check_exceptions(exceptions)
|
||||||
|
|
||||||
Rake::Task['db:_dump'].invoke
|
Rake::Task['db:_dump'].invoke
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue