<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>9116</bug_id>
          
          <creation_ts>2016-02-15 11:52:31 +0000</creation_ts>
          <short_desc>migrations fail to apply on mysql</short_desc>
          <delta_ts>2016-03-01 13:52:03 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Toaster</product>
          <component>toaster</component>
          <version>2.1</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>2.1 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Wood">michael.g.wood</reporter>
          <assigned_to name="Michael Wood">michael.g.wood</assigned_to>
          <cc>belen.barros.pena</cc>
    
    <cc>brian.avery</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>stanciux.mihail</cc>
          
          <qa_contact name="Mihail Stanciu">stanciux.mihail</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>59000</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Wood">michael.g.wood</who>
    <bug_when>2016-02-15 11:52:31 +0000</bug_when>
    <thetext>Currently the migrations fail to apply on mysql

django.db.utils.OperationalError: (1829, &quot;Cannot drop column &apos;id&apos;: needed in a foreign key constraint &apos;D1a8c915f90ee0694e71f27b384a7341&apos; of table &apos;toaster.orm_customimagerecipe_packages&apos;&quot;)

This is because of mysql doesn&apos;t support being able to drop a primary key which is currently &apos;in use&apos;. orm.0002_auto_20151210_1209

We may need to detect if we&apos;re using mysql and do a slightly different migration.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59093</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Wood">michael.g.wood</who>
    <bug_when>2016-02-16 10:59:06 +0000</bug_when>
    <thetext>After investigation we have no choice other than to reset migrations

I&apos;ve tried adding an intermediate migration which drops the CustomImageRecipe table and recreates it but this hits a Django bug https://code.djangoproject.com/ticket/24225 I&apos;ve also tried renaming it and various combinations of removing all the fields which hold the foreign key relationship and then re-creating them with the corrected relationships. We also have a slightly broken migration tree with two migrations 0002 that depend on the initial migration.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59136</commentid>
    <comment_count>2</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2016-02-17 03:55:34 +0000</bug_when>
    <thetext>If I have a toaster.sqlite from jethro, these migrations break on the existing jethro database.  If so, we will need to spell out in the docs that in order to take advantage of the new image customization feature users will need to start with a fresh db.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59530</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Wood">michael.g.wood</who>
    <bug_when>2016-02-29 14:59:27 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=8469e5802590551dbf88a26539b9cfe5710c074d

 (Bitbake rev: 19bd63fc3a28dcbd0f531a5b06a037da34568bac)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59580</commentid>
    <comment_count>4</comment_count>
    <who name="Mihail Stanciu">stanciux.mihail</who>
    <bug_when>2016-03-01 13:52:03 +0000</bug_when>
    <thetext>Verified while setting up MySQL instance for GDC.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>