[LRUG] Multiple databases, migration, integration...

Riccardo Tacconi rtacconi at gmail.com
Fri Jan 8 07:06:33 PST 2010


I am trying a mix approach:


   - refactoring of legacy tables with views (and can update and write data
   too);
   - Rails table has _ prepended;

Bolow I was meaning the migration file, not schema.rb. However I just need
to create a model class to access a table with ActiveRecord.

I think I am on the right way, thanks for your help.

On Fri, Jan 8, 2010 at 12:29 PM, Riccardo Tacconi <rtacconi at gmail.com>wrote:

> Ok guys,
>
> Sorry if I have created some confusion but I am not yet an expert in
> migrations. I will need to read and write tables, although I might use
> read_only_model in the future. My fear is to modifying schema of old tables,
> not the data. I suppose that a table that is not defined in schema.rb will
> not be touched by Rails and by using:
>
> create_table "posts", :force => false do |t|
>
> Any migration will modify that table (:force set to false). Since I
> consider myself new to Rails, I do not know all the magic things happening
> behind the scenes.
>
>
> On Fri, Jan 8, 2010 at 12:13 PM, David Salgado <david at digitalronin.com>wrote:
>
>> > I am still not understanding how you manage your migrations. How do you
>> 'I
>> > just make sure all
>> > migrations happen from within the Rails codebase'? Is there a way to
>> exclude
>> > legacy tables from a Rails environment?
>>
>> No, I just don't consider them to be 'legacy' tables. I just treat
>> them in exactly the same way as any other table in a rails app.
>>
>> I have a git project for the rails app. and a git project for the PHP
>> app. Both use the same database. I only ever allow migrations in the
>> rails app., even if the migration is for something in the PHP app.
>> That way, the schema_migrations records in the rails app. are always
>> consistent, and I don't have to worry about managing migrations that
>> could have happened from PHP-land as well, which would be a nightmare.
>>
>> David
>> _______________________________________________
>> 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
>



-- 
Riccardo Tacconi
Web developer at Wolseley UK
VIRTUELOGIC LIMITED (Director)

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/8452987d/attachment.html>


More information about the Chat mailing list