[Ruby] Converting mysql to postgres

Corey Jewett ml at syntheticplayground.com
Sun Aug 6 21:56:58 PDT 2006


On Aug 6, 2006, at 3:19 PM, Ryan Davis wrote:

>
> On Aug 6, 2006, at 1:00 AM, Corey Jewett wrote:
>
>> Depending on how much effort you want to put into the conversion you
>> could build Og versions of your models, setup connections to both dbs
>> and walk all the models.
>>
>> http://nitroproject.com/wiki/pages/Programming+Og/Documentation
>>
>> Easier would probably be to write some regexs and do some sub!s.
>
> Easier would also be to use rails... Why would Og be a good idea for
> this? I've not used it so maybe I'm missing something.

Because you can't have the same set of models simultaneously point at  
2 different databases with Rails. Otherwise, yeah ActiveRecord would  
solve the problem better. Og would also be a poor choice if you had a  
lot of tables since you have to recode your schema into the models.  
ActiveRecord bootstraps based on your db schema, Og generates the  
schema from your models. Come to think of it Og will probably not end  
up creating a schema you can even dump your data back into, so I  
retract my suggestion.

Much as I want to like Og for single script database tasks (e.g. not  
web based), I keep finding myself embedding ActiveRecord and using  
Migrations to bootstrap a schema. Anybody else done anything like this?

Corey


More information about the Ruby mailing list