Florian Schaf
2008-Jul-05 17:20 UTC
one db - many rails projects -> many schema_migrations table
Hi all! How can I change the name of the schema_migrations table? I have to do this because I can only use one database but want to have several rails projects. I hope this is possible at all. greets flo schaf -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Bharat Ruparel
2008-Jul-05 19:48 UTC
Re: one db - many rails projects -> many schema_migrations t
Interesting! Depending on which database you are using, you can explore different database schemas owned by different users within the same physical database. I know that Oracle and MySQL use different terminology to achieve the same results. Mainly, though, I recommend that you drive this differentiation by creating different schema owner accounts that have visibility to the set of common tables and hide the schema_migration table from other accounts. Yet another approach can be to use updatable views, but that is definitely not portable and some databases may not even support it, so I will stick with the first approach. You may want to work with someone who has DBA level knowledge of the specific database that you are using. Bharat Florian Schaf wrote:> Hi all! > > How can I change the name of the schema_migrations table? I have to do > this because I can only use one database but want to have several rails > projects. > I hope this is possible at all. > greets > flo schaf-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jf Rejza
2008-Nov-07 13:47 UTC
Re: one db - many rails projects -> many schema_migrations table
Florian Schaf wrote: I have the same problem. Did a find a solution? JEF -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Allan
2008-Nov-07 18:09 UTC
Re: one db - many rails projects -> many schema_migrations table
Hi, poking round the source I see: def schema_migrations_table_name Base.table_name_prefix + ''schema_migrations'' + Base.table_name_suffix end in activerecord-2.1.0/lib/active_record/migration.rb I suppose you could override this method in that class and then call initialize_schema_migrations_table. Have you tried just having multiple migrations and just letting the migration code work it out for itself? Rails should handle intermediate migrations with timestamps (I think!) Allan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jf Rejza
2008-Nov-07 18:46 UTC
Re: one db - many rails projects -> many schema_migrations table
> > poking round the source I see: > > def schema_migrations_table_name > Base.table_name_prefix + ''schema_migrations'' + > Base.table_name_suffix > endI need to over write this method only for one app not for all. Is it possible to do so into the app? If so where to over_write the code?> Have you tried just having multiple migrations and just letting the > migration code work it out for itself? Rails should handle > intermediate migrations with timestamps (I think!)you mean the mean the timestamps that prefixe the migrations file? I replace it by an integer. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---