[LRUG] Multiple databases, migration, integration...
Riccardo Tacconi
rtacconi at gmail.com
Fri Jan 8 04:01:31 PST 2010
Ok Andrew,
I thought I had to configure it in each class model! But how do you use
migrations in your environment without messing up with the Mambo's tables?
Thanks again
On Fri, Jan 8, 2010 at 11:57 AM, Andrew Stewart
<boss at airbladesoftware.com>wrote:
>
> On 8 Jan 2010, at 11:52, Riccardo Tacconi wrote:
>
>> If I use :table_name_prefix => "rails_" I suppose that a table rails_teams
>> will be defined in Rails as teams, isn't it? Otherwise I cannot see the
>> utility.
>>
>
> That's right. In your config/environment.rb you would add:
>
> config.active_record.table_name_prefix = 'rails_'
>
> Then your Team model would map to the table rails_teams. Once the prefix
> is configured you forget all about it in your code. For example, if you
> wanted to add a column later on via a migration, you would do:
>
> add_column :teams, :name, :string
>
> ...and not `add_column :rails_teams ...`
>
>
> Regards,
>
> Andy Stewart
> -------
> http://airbladesoftware.com
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
--
Riccardo Tacconi
VIRTUELOGIC LIMITED
http://www.linkedin.com/in/riccardotacconi
http://riccardotacconi.blogspot.com/
http://twitter.com/rtacconi
Linux user: #400461
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20100108/cccf9bbf/attachment-0003.html>
More information about the Chat
mailing list