w pliku konfiguracyjnym (config/environment.rb dla wszystkich środowiskach lub config/środowiskach/$ (środowisko) .rb tylko dla konkretnego środowiska) dodaj ten wiersz:
config.paths['db/migrate'] += 'db/migrate/other_db'
A jeśli chcesz zmienić domyślne 'db/migrate' ścieżkę (config.paths [ 'db/migrować'] jest tablicą z jeden ciąg "db/migrate" domyślnie), zrób to:
config.paths['db/migrate'] = ['db/my_migrate']
Oto domyślne config.paths, które również mogą zmienić:
"app" => ["app"],
"app/assets" => ["app/assets"],
"app/controllers" => ["app/controllers"],
"app/helpers" => ["app/helpers"],
"app/models" => ["app/models"],
"app/mailers" => ["app/mailers"],
"app/views" => ["app/views"],
"lib" => ["lib"],
"lib/assets" => ["lib/assets"],
"lib/tasks" => ["lib/tasks"],
"config" => ["config"],
"config/environments" => ["config/environments"],
"config/initializers" => ["config/initializers"],
"config/locales" => ["config/locales"],
"config/routes" => ["config/routes.rb"],
"db" => ["db"],
"db/migrate" => ["db/migrate"],
"db/seeds" => ["db/seeds.rb"],
"vendor" => ["vendor"],
"vendor/assets" => ["vendor/assets"],
"vendor/plugins" => ["vendor/plugins"],
"config/database" => ["config/database.yml"],
"config/environment" => ["config/environment.rb"],
"lib/templates" => ["lib/templates"],
"log" => ["log/development.log"],
"public" => ["public"],
"public/javascripts" => ["public/javascripts"],
"public/stylesheets" => ["public/stylesheets"],
"tmp" => ["tmp"],
W Rails 4: 'config.paths [ 'db/migrować'] <<„db/migrować/other_db'' – Kris
Poprawna odpowiedzią jest 'config.paths ['db/migrate'] << 'db/migrate/other_db'' dla Rails 3 lub 4. – pisaruk
' config.paths [' db/migrate '] + = [' db/migrate/other_db "] też by działało. –