[Ovirt-devel] Multi-databases support

Mohammed Morsi mmorsi at redhat.com
Mon Oct 19 18:49:11 UTC 2009


Mohammed Morsi wrote:
> Loiseleur Michel wrote:
>   
>> Hi,
>>
>> While I was hacking ovirt-server, I have found that it's currently
>> restricted to Postgres DB. Even if I like postgres for serious work on
>> a server, I really prefer to hack/dev locally on a Sqlite or MySQL DB.
>>
>> I have googled on rails in order to find a good answer for the
>> "foreign key problem" which forces OVirt to stay on pg. I have found a
>> plugin on this particular problem, named foreigner :
>> http://github.com/matthuhiggins/foreigner
>>
>> It provides a rails' syntax to common operation on them. For instance :
>>
>>   add_foreign_key(from_table, to_table, options)
>>   remove_foreign_key(from_table, options)
>>   foreign_keys(table_name)
>>
>> I really like to keep my development computer to run as fast as
>> possible (ie without a database service), so I have even tried to
>> integrate this plugin into OVirt, in a transparent way for existing db.
>>
>> After a couple of patch on the plugin itself and some hack on
>> migrations, it seems that I manage to do it. The 3 patchs following
>> this email allows OVirt to support multiple open source database
>> without losing functionality, without losing existing databases and
>> with a small readability enhancement on db migrations.
>>
>> What do you think of it ? Feel free to contact me by email, on this
>> list or by irc (nick: Coren`)
>>
>> Regards,
>>     
> Thank you greatly for this. I agree, and am sure many others do that
> multiple database support would be great. I applied all three patches
> but ran into some problems when running them. Comments are in line in
> the patches.
>
>    -Mo
>
>   
Excellent, with your latest patches, everything works. I verified it w/
a running system, against the dev/test env (also ran the tests), and
when applied before a production install. I also ran through the code
and nothing looks offhand glancing at it. I only tested this against our
current oVirt setup w/ the postgres db, and not w/ mysql or any others,
but postgres support now doesn't break, so its committable.

ACK and pushed. Thanks for this and again sorry for the delay. Its up to
you, but if you want to write a patch adding instructions for mysql or
any other db to the top of src/config/databases.yml, as we have w/
postgresql there, I would ack it. Also if you wanted/needed to add
support to the oVirt installer/rpms permitting mysql or any other db to
be selected and configured instead of postgresql, I can also review /
push those. As I said, up to you, and once again thanks for this patchset.

    -Mo




More information about the ovirt-devel mailing list