[Engine-devel] Questions about database changes

--_000_B2CAFC4D5E2D574A883EF61ACD5ADE3301810A60SERV070corpeldo_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi everyone, I would like some feedback about how to create the upgrade script that crea= tes columns for the architecture of each VM, template and cluster in the en= gine database. The changes #17853 and #16700 introduce a field (and the respective Enum) u= sed to store the target architecture of a cluster, VM or template (which cu= rrently can be either x86_64, ppc64 or undefined). In their current state, these changes introduce a VARCHAR column storing th= e architecture, but now I wanted to implement an autocompleter for this fie= ld in the search backend, and it would be massively cleaner and easier to u= se the architecture field as an integer (since Enums that implement the Ide= ntifiable interface can use the EnumValueAutoCompleter class). Considering that these two changes are already in review, should I modify t= hem directly to use an integer or should I create another patch that change= s the column in the database? If I create another patch, should it modify t= he 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 --_000_B2CAFC4D5E2D574A883EF61ACD5ADE3301810A60SERV070corpeldo_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr= osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" = xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:= //www.w3.org/TR/REC-html40"> <head> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
</p> <p class=3D"MsoNormal"><span lang=3D"EN-US"><o:p> </o:p></span></p> <p class=3D"MsoNormal"><span lang=3D"EN-US">The changes #17853 and #16700 i= ntroduce a field (and the respective Enum) used to store the target archite= cture of a cluster, VM or template (which currently can be either x86_64, p=
<meta name=3D"Generator" content=3D"Microsoft Word 14 (filtered medium)"> <style><!-- /* Font Definitions */ @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0cm; margin-bottom:.0001pt; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-fareast-language:EN-US;} a:link, span.MsoHyperlink {mso-style-priority:99; color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {mso-style-priority:99; color:purple; text-decoration:underline;} span.EmailStyle17 {mso-style-type:personal-compose; font-family:"Calibri","sans-serif"; color:windowtext;} .MsoChpDefault {mso-style-type:export-only; font-family:"Calibri","sans-serif"; mso-fareast-language:EN-US;} @page WordSection1 {size:612.0pt 792.0pt; margin:70.85pt 3.0cm 70.85pt 3.0cm;} div.WordSection1 {page:WordSection1;} --></style><!--[if gte mso 9]><xml> <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" /> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext=3D"edit"> <o:idmap v:ext=3D"edit" data=3D"1" /> </o:shapelayout></xml><![endif]--> </head> <body lang=3D"PT-BR" link=3D"blue" vlink=3D"purple"> <div class=3D"WordSection1"> <p class=3D"MsoNormal"><span lang=3D"EN-US">Hi everyone,<o:p></o:p></span><= /p> <p class=3D"MsoNormal"><span lang=3D"EN-US"><o:p> </o:p></span></p> <p class=3D"MsoNormal"><span lang=3D"EN-US">I would like some feedback abou= t how to create the upgrade script that creates columns for the architectur= e of each VM, template and cluster in the engine database.<o:p></o:p></span= pc64 or undefined).<o:p></o:p></span></p> <p class=3D"MsoNormal"><span lang=3D"EN-US">In their current state, these c= hanges introduce a VARCHAR column storing the architecture, but now I wante= d to implement an autocompleter for this field in the search backend, and i= t would be massively cleaner and easier to use the architecture field as an integer (since Enums that implement th= e Identifiable interface can use the EnumValueAutoCompleter class).<o:p></o= :p></span></p> <p class=3D"MsoNormal"><span lang=3D"EN-US"><o:p> </o:p></span></p> <p class=3D"MsoNormal"><span lang=3D"EN-US">Considering that these two chan= ges 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? I= f I create another patch, should it modify the upgrade script from change #16700 or it must create another scr= ipt that migrates the column from a VARCHAR to an INTEGER?<o:p></o:p></span=
</p> <p class=3D"MsoNormal"><span lang=3D"EN-US"><o:p> </o:p></span></p> <p class=3D"MsoNormal">Thanks,<o:p></o:p></p> <p class=3D"MsoNormal">Vitor de Lima<o:p></o:p></p> <p class=3D"MsoNormal"><o:p> </o:p></p> </div> </body> </html>
--_000_B2CAFC4D5E2D574A883EF61ACD5ADE3301810A60SERV070corpeldo_--

----- Original Message -----
From: "Vitor de Lima" <vitor.lima@eldorado.org.br> To: engine-devel@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@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

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@redhat.com> To: "Vitor de Lima" <vitor.lima@eldorado.org.br> Cc: engine-devel@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@eldorado.org.br> To: engine-devel@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@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

----- Original Message -----
From: "Yair Zaslavsky" <yzaslavs@redhat.com> To: "Vitor de Lima" <vitor.lima@eldorado.org.br> Cc: engine-devel@ovirt.org Sent: Wednesday, August 28, 2013 9:56:26 AM Subject: Re: [Engine-devel] Questions about database changes
----- Original Message -----
From: "Vitor de Lima" <vitor.lima@eldorado.org.br> To: engine-devel@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)
I agree , patches are not merged yet , so change should be in original upgrade it will not affect anyone except of the specific developer that tested that....
Cheers, Yair
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
participants (4)
-
Eli Mesika
-
Laszlo Hornyak
-
Vitor de Lima
-
Yair Zaslavsky