views:

294

answers:

2

Hello,

I want to run two rails websites (homepage and app) on the same database. However, migrations dont work because both websites try to use schema_migrations table at the same time.

Is it possible to override default schema_migrations table name? Any other ideas how to solve this problem?

+1  A: 

The schema_migrations table name is kept in ActiveRecord::Migrator.schema_migrations_table_name, which you might me able to override (in environment.rb, initializers, etc.), but I haven't tried this.

On the other hand, if you use unique migration IDs in both application (default in 2.1 onwards, I think), migrations from two applications should work with a single schema_migrations table.

See this screencast for more information on how migrations work in Rails 2.1 and up.

Can Berk Güder
ActiveRecord::Migrator.schema_migrations_table_name seems to be frozen and rails doesnt allow t override it.Hmm, I'll try to have both apps to write into the same schema_migrations.Thanks for the answer anyway
Mantas
A: 

Could you use Rails Engines for your different sites? Don't know if that would work for your situation, but it would eliminate this problem.

http://rails-engines.org/news/2009/02/02/engines-in-rails-2-3

Ben