ruby on rails - How to configure an extra/different migrations folder -
a colleague , working in different projects share models. so, sharing models through git submodule.
additionally, we'd able share migrations:
in way, colleague's migrations in folder db/migrate/other_db
of project.
how can configure rails migrations run migrations in folder?
in config file (config/application.rb environments or config/environments/$(environment).rb particular environment) add line:
config.paths['db/migrate'] += 'db/migrate/other_db'
and if want change default 'db/migrate' path (config.paths['db/migrate'] array 1 string 'db/migrate' default), this:
config.paths['db/migrate'] = ['db/my_migrate']
here default config.paths, can change:
"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"],
Comments
Post a Comment