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

Hakan Şenol Ensari hakan.ensari at theorydot.com
Fri Jan 8 07:52:14 PST 2010


I'm in the same boat and am likewise using views to run a Rails app in
parallel.

Perhaps an even cooler approach might be to do the reverse: Migrate tables
right away and support the old app through views?

That way, you could start further messing around with the tables in the
Rails project without having to wait to decommission the legacy app. When
done with the latter, you'd simply delete the views.

Of course I'm assuming the tables don't require any other refactoring other
than table, column names and other petty nuisances.

Hakan

http://ultra.bohe.me


2010/1/8 Riccardo Tacconi <rtacconi at gmail.com>

> 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
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20100108/56e5fbdb/attachment-0003.html>


More information about the Chat mailing list