Fix rake task to seed Geo tracking database

It was broken because abort_if_pending_migrations
would loop through the configs for all databases
and check for pending migrations.

So db:abort_if_pending_migrations was looking for
a database that does not exist in the Geo PostgreSQL
instance.

Changelog: fixed
EE: true
parent 9ec1872a
......@@ -25,7 +25,7 @@ db_namespace = namespace :db do
ActiveRecord::Tasks::DatabaseTasks.for_each(databases) do |name|
desc "Creates the #{name} database, loads the schema, and initializes with the seed data (use db:reset:#{name} to also drop the database first)"
task name => ["db:create:#{name}", :environment, "db:schema:load:#{name}", "db:seed"]
task name => ["db:create:#{name}", :environment, "db:schema:load:#{name}", "db:seed:#{name}"]
end
end
......@@ -52,7 +52,7 @@ db_namespace = namespace :db do
desc "Loads the seed data from ee/db/geo/seeds.rb"
task geo: :load_config do
db_namespace["abort_if_pending_migrations"].invoke
db_namespace["abort_if_pending_migrations:geo"].invoke
ActiveRecord::Tasks::DatabaseTasks.seed_loader = seed_loader
ActiveRecord::Tasks::DatabaseTasks.load_seed
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment