[Toaster] [review-request][PATCH] toaster: make 0021 migration compatible with MySQL

Smith, Elliot elliot.smith at intel.com
Fri Aug 14 06:19:29 PDT 2015


On 14 August 2015 at 13:26, Smith, Elliot <elliot.smith at intel.com> wrote:

> On 14 August 2015 at 11:51, Damian, Alexandru <alexandru.damian at intel.com>
> wrote:
>
>> One of intended effects of this migration is to make sure that we have a
>> Project with id "0" and release None after this migration is run.
>>
>> After this patch is merged, there is no guarantee that this entry in the
>> database will exist, unless I'm missing something.
>>
>> Can you please add code to the migration to automatically add the Project
>> id 0 entry if it does not exist ?
>>
>
> Is this to ensure that there is a "Default project" in the database with
> ID 0? From what I've seen, the default project is the one which builds are
> attached to if they are started outside of Toaster by bitbake. So is the
> intention to ensure that any Build object will get a project ID of 0 if
> that object is not explicitly associated with a Project when it is created?
>

I did some more digging and found that the issue is with the ID being 0,
rather than 1, as MySQL autoincrement fields start at 1 (
http://stackoverflow.com/questions/20328905/south-migration-database-backend-does-not-accept-0-as-a-value-for-autofield
).

If I change to default=1 for the project_id field, there's no problem, and
I just need no_dry_run = True to get migrations working with MySQL. Would
this be an acceptable solution? (I'm assuming there's nowhere in the code
base where a project ID of 0 is hard-coded.)

Elliot
-- 
Elliot Smith
Software Engineer
Intel Open Source Technology Centre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/toaster/attachments/20150814/4f719811/attachment-0001.html>


More information about the toaster mailing list