Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Support multiple databases in migrations

#6391

ActiveRecord natively supports multiple database connections. There's no reason for migrations not to do the same.

Not to mess things up, migrations for default database should still reside in db/migrate, while others should reside in db/migrate/database_config_name_without_environment_name.

Also, db:migrate should support option for specifying which database to run migrations on.

Directory layout example:

db/migrate db/migrate/second

Corresponding db config:

### config/database.yml
development:
  adapter: sqlite3
  database: main_development

test:
  adapter: sqlite3
  database: main_test

production:
  adapter: sqlite3
  database: main_production

second_development:
  adapter: postgresql
  database: second_development

second_test:
  adapter: postgresql
  database: second_test

second_production:
  adapter: postgresql
  database: second_production

Reported by Arthur Pirogovski · February 8th, 2011 @ 10:28 PM

State: new
Milestone: none
Assigned to: nobody
Importance: none

Activity

No comments yet.