Hi Vitor,
Just one more note, use an int stored in the enum and ignore the ordinal when
storing/reading from the DB, so when adding new members and re-ordering the enum, the DB
will still be ok.
----- Original Message -----
From: "Yair Zaslavsky" <yzaslavs(a)redhat.com>
To: "Vitor de Lima" <vitor.lima(a)eldorado.org.br>
Cc: engine-devel(a)ovirt.org
Sent: Wednesday, August 28, 2013 8:56:26 AM
Subject: Re: [Engine-devel] Questions about database changes
----- Original Message -----
> From: "Vitor de Lima" <vitor.lima(a)eldorado.org.br>
> To: engine-devel(a)ovirt.org
> Sent: Tuesday, August 27, 2013 4:18:12 PM
> Subject: [Engine-devel] Questions about database changes
>
> Hi everyone,
>
> I would like some feedback about how to create the upgrade script that
> creates columns for the architecture of each VM, template and cluster in
> the
> engine database.
>
> The changes #17853 and #16700 introduce a field (and the respective Enum)
> used to store the target architecture of a cluster, VM or template (which
> currently can be either x86_64, ppc64 or undefined).
> In their current state, these changes introduce a VARCHAR column storing
> the
> architecture, but now I wanted to implement an autocompleter for this field
> in the search backend, and it would be massively cleaner and easier to use
> the architecture field as an integer (since Enums that implement the
> Identifiable interface can use the EnumValueAutoCompleter class).
>
> Considering that these two changes are already in review, should I modify
> them directly to use an integer or should I create another patch that
> changes the column in the database? If I create another patch, should it
> modify the upgrade script from change #16700 or it must create another
> script that migrates the column from a VARCHAR to an INTEGER?
>
> Thanks,
> Vitor de Lima
If still under review, why not modify the existing patches for review? (i.e -
use the same change-id where needed)
Cheers,
Yair
>
>
> _______________________________________________
> Engine-devel mailing list
> Engine-devel(a)ovirt.org
>
http://lists.ovirt.org/mailman/listinfo/engine-devel
>
_______________________________________________
Engine-devel mailing list
Engine-devel(a)ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel