<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">at bottom:-<br>
      On Wednesday 02 September 2015 04:01 PM, shirish wrote:<br>
    </div>
    <blockquote cite="mid:55E70F5C.5040905@hamaralinux.org" type="cite">
      <br>
      <br>
      <br>
      -------- Forwarded Message -------- <br>
      Subject: Re: Upgrade to 5.0 - Problem dropping foreign key <br>
      Date: Fri, 10 Jul 2015 18:45:04 +0200 <br>
      From: Thorsten Schöning <a class="moz-txt-link-rfc2396E"
        href="mailto:tschoening@am-soft.de"><tschoening@am-soft.de></a>
      <br>
      Organization: AM-SoFT IT-Systeme <br>
      To: <a class="moz-txt-link-abbreviated"
        href="mailto:support-bugzilla@lists.mozilla.org">support-bugzilla@lists.mozilla.org</a>
      <a class="moz-txt-link-rfc2396E"
        href="mailto:support-bugzilla@lists.mozilla.org"><support-bugzilla@lists.mozilla.org></a>
      <br>
      <br>
      Guten Tag Jonathan Goldberg, <br>
      am Freitag, 10. Juli 2015 um 17:33 schrieben Sie: <br>
      <br>
      <blockquote type="cite">Some years ago, we experimented <br>
        with Testopia, but never actually used it. <br>
      </blockquote>
      <br>
      Would have been better to use a different installation... <br>
      <br>
      <blockquote type="cite"> We don't do any <br>
        customization, so I always upgrade Bugzilla using the tar ball.
        <br>
        This should overwrite any patching of Bugzilla files that the <br>
        Testopia installation does.  I have also dropped all of the
        "test_*" tables from the database. <br>
      </blockquote>
      <br>
      Bugzilla manages the current state of its schema in the table <br>
      bz_schema, just dropping tables is not enough. Extensions like
      those <br>
      for Testopia can register themself for changing the schema and are
      <br>
      added to bz_schema representation that way, so Bugzilla is always
      <br>
      aware that it might need to do additional things during upgrades
      for <br>
      the extensions. The interesting thing is how to completely
      uninstall <br>
      extensions, so they are removed from the schema as well. From what
      I <br>
      know there's currently no proper way to do this, the only thing
      I'm <br>
      aware of is disabling an extension. Removing from the schema is a
      <br>
      heavy task of course, the user might loose data from the extension
      and <br>
      such... <br>
      <br>
      So to make a long story short, you need to change the content of <br>
      bz_schema as well and remove everything testopia added. The
      structure <br>
      is a simple Perl hash, easy readable in any text editor. Get it
      from <br>
      the table, change it, update it or something like that, depends on
      the <br>
      tools you have. You can compare it with a fresh empty installation
      of <br>
      4.4.9, shouldn't be too hard to find the differences using some
      diff <br>
      tool. <br>
      <br>
      Because you already dropped the testopia tables, installing it
      again <br>
      and just disabling it won't help you, because installation surely
      will <br>
      fail. But it may be worth a try... <br>
      <br>
      Mit freundlichen Grüßen, <br>
      <br>
      Thorsten Schöning <br>
      <br>
    </blockquote>
    @Shirish : Thanks for the help, But I have already gone through this
    page. <span class="moz-smiley-s1"><span> :-) </span></span><br>
    <br>
    Let me tell you what I have tried.<br>
    <br>
    1. Removed bz_schema and "test_*" tables from the database. <br>
    2. Only dropped "test_*" tables from the database. <br>
    3. Removed all foreign key relation from "test_*" tables.<br>
    4. Removed Testopia from extensions.<br>
    5. Changed bz_schema and removed "test_*" tables.<br>
    <br>
    But still no luck <br>
    <br>
    <i><small>DBD::mysql::db do failed: Can't create table
        'hamarabugzilla.#sql-65f_de' (errno: 150) [for Statement "ALTER
        TABLE test_case_components ADD <br>
             CONSTRAINT
        fk_test_case_components_component_id_components_id FOREIGN KEY
        (component_id)<br>
             REFERENCES components(id)<br>
              ON UPDATE CASCADE ON DELETE CASCADE"] at Bugzilla/DB.pm
        line 642.<br>
           
        Bugzilla::DB::bz_add_fks('Bugzilla::DB::Mysql=HASH(0x77e9e40)',
        'test_case_components', 'HASH(0x6d0da18)', 'HASH(0xb076038)')
        called at Bugzilla/DB.pm line 546<br>
           
        Bugzilla::DB::bz_setup_foreign_keys('Bugzilla::DB::Mysql=HASH(0x77e9e40)')
        called at Bugzilla/Install/DB.pm line 745<br>
           
        Bugzilla::Install::DB::update_table_definitions('HASH(0x20e0358)')
        called at ./checksetup.pl line 172</small></i><br>
    <br>
    Thanks,<br>
    Anant<br>
    <div class="moz-signature">-- <br>
      <table cellpadding="0" cellspacing="0" border="0" width="100%">
        <style type="text/css">
@import url(<a class="moz-txt-link-freetext" href="http://fonts.googleapis.com/css?family=Lato:300,400,600,800">http://fonts.googleapis.com/css?family=Lato:300,400,600,800</a>);
a { text-decoration: none; }
.appleLinks a {color:#28336C;}
</style> <tbody>
          <tr>
            <td align="left" bgcolor="#fff" valign="top">
              <table cellpadding="0" cellspacing="0" align="left"
                border="0" width="300">
                <tbody>
                  <tr>
                    <td style="font-size:0; line-height:0;" align="left"
                      bgcolor="#fff" valign="top" width="12"> <img
src="http://www.techbluesoftware.co.in/documents/15491/115033/spacer7.gif"
                        moz-do-not-send="true" alt="" height="1"
                        width="12"> </td>
                    <td style=" font-family:'Lato', Helvetica, Arial,
                      sans-serif; font-size:16px; color:#2d5259;
                      line-height:18px; padding:0px;
                      background-color:#FFFFFF" align="left"
                      valign="top"> <font style="font-weight:bold;
                        color:#28336C;">Anant Saraswat<br>
                      </font>
                      <p style="font-size:14px; font-weight:bold;
                        color:#A9A918; text-decoration:none; margin:0;
                        padding:0">System Administrator<br>
                      </p>
                    </td>
                  </tr>
                </tbody>
              </table>
            </td>
          </tr>
          <tr>
            <td style="font-size:0; line-height:0;" align="left"
              bgcolor="#fff" valign="top"> <img
src="http://www.techbluesoftware.co.in/documents/15491/115033/spacer6.gif"
                moz-do-not-send="true" alt="" height="10" width="1"></td>
          </tr>
          <tr>
            <td align="left" bgcolor="#fff" valign="top">
              <table cellpadding="0" cellspacing="0" align="left"
                border="0" width="300">
                <tbody>
                  <tr>
                    <td style="font-size:0; line-height:0;" align="left"
                      bgcolor="#fff" valign="top" width="12"> <img
src="http://www.techbluesoftware.co.in/documents/15491/115033/spacer7.gif"
                        moz-do-not-send="true" alt="" height="1"
                        width="12"> </td>
                    <td style=" font-family:'Lato', Helvetica, Arial,
                      sans-serif; font-size:12px; color:#2d5259;
                      line-height:18px; padding:0px;
                      background-color:#FFFFFF" align="left"
                      valign="top"> <font style=" color:#28336C;">Direct:

                        +91 124 4548387</font><br>
                      <font style=" color:#28336C;">Tel: +91 124 4548383
                        Ext- 1018</font><br>
                      <font style=" color:#28336C;">UK: +44 845 0047 142
                        Ext- 5020</font><br>
                    </td>
                  </tr>
                </tbody>
              </table>
            </td>
          </tr>
          <tr>
            <td style="font-size:0; line-height:0;" align="left"
              bgcolor="#fff" valign="top"> <img
src="http://www.techbluesoftware.co.in/documents/15491/115033/spacer6.gif"
                moz-do-not-send="true" alt="" height="10" width="1"></td>
          </tr>
          <tr>
            <td style="font-size:0; line-height:0;" align="left"
              bgcolor="#fff" valign="top"> <img
src="http://www.techbluesoftware.co.in/documents/15491/115033/spacer7.gif"
                moz-do-not-send="true" alt="" height="18" width="1"></td>
          </tr>
          <tr>
            <td style=" padding:0px" align="left" bgcolor="#fff"
              valign="top">
              <table style="padding:0px" cellpadding="0" cellspacing="0"
                align="left" border="0" width="280">
                <tbody>
                  <tr>
                    <td style="font-size:0; line-height:0;" align="left"
                      bgcolor="#fff" valign="top" width="12"> <img
src="http://www.techbluesoftware.co.in/documents/15491/115033/spacer6.gif"
                        moz-do-not-send="true" alt="" height="1"
                        width="12"> </td>
                    <td style="padding:0; margin:0" align="left"
                      valign="top" width="280"> <a
                        href="http://www.techbluesoftware.co.in"><img
src="http://www.techbluesoftware.co.in/documents/15491/115033/tbs-logo.gif"
                          moz-do-not-send="true" alt="TBS Website"
                          style="padding:0" border="0" width="87"></a> </td>
                  </tr>
                  <tr>
                    <td style="font-size:0; line-height:0;" align="left"
                      bgcolor="#fff" valign="top"> <img
src="http://www.techbluesoftware.co.in/documents/15491/115033/spacer7.gif"
                        moz-do-not-send="true" alt="" height="18"
                        width="1"> </td>
                  </tr>
                  <tr>
                    <td style="font-size:0; line-height:0;" align="left"
                      bgcolor="#fff" valign="top" width="12"> <img
src="http://www.techbluesoftware.co.in/documents/15491/115033/spacer6.gif"
                        moz-do-not-send="true" alt="" height="1"
                        width="12"> </td>
                    <td style=" width:300px; font-size:12px;
                      font-family:'Lato', Helvetica, Arial, sans-serif;
                      font-weight:bold; color:#28336C;
                      line-height:14px;" align="left" valign="top">Techblue

                      Software Pvt. Ltd<br>
                      <span style="color:#28336C; font-size:12px;
                        line-height:16px; font-weight:normal">The Palms,
                        Plot No 73, Sector 5, IMT Manesar,<br>
                        Gurgaon- 122050 (Hr.)<br>
                      </span>
                      <p style="font-weight:bold; padding:0;
                        margin-top:5px; font-size:12px
                        text-decoration:none;"><a
                          href="http://www.techbluesoftware.co.in"
                          style="text-decoration:none; color:#28336C; ">www.techbluesoftware.co.in</a></p>
                    </td>
                    <td style="color:#28336C; font-size:10px;
                      line-height:16px"> <br>
                    </td>
                  </tr>
                  <tr>
                    <td style="font-size:0; line-height:0;" align="left"
                      bgcolor="#fff" valign="top" width="12"> <img
src="http://www.techbluesoftware.co.in/documents/15491/115033/spacer6.gif"
                        moz-do-not-send="true" alt="" height="1"
                        width="12"> </td>
                    <td style="padding-top:10px" align="left"
                      valign="top" width="196"> <a
href="https://www.facebook.com/pages/Techblue-Software-Limited/441777369284888"><img
src="http://www.techbluesoftware.co.in/documents/15491/115033/fb.gif"
                          moz-do-not-send="true" nosend="1" alt="TBS
                          Facebook" title="TBS Facebook" border="0"
                          height="25" width="25"></a> <a
                        href="https://twitter.com/TechbluSoftware"><img
src="http://www.techbluesoftware.co.in/documents/15491/115033/tweet.gif"
                          moz-do-not-send="true" nosend="1" alt="TBS
                          Twitter" title="TBS Twitter" border="0"
                          height="25" width="25"></a> <a
                        href="https://plus.google.com/+TechblueSoftwareCoIn"><img
src="http://www.techbluesoftware.co.in/documents/15491/115033/google-plus.gif"
                          moz-do-not-send="true" nosend="1" alt="TBS
                          Google+" title="TBS Google+" border="0"
                          height="25" width="25"></a> <a
                        href="https://www.linkedin.com/company/techblue-softwares-pvt-ltd"><img
src="http://www.techbluesoftware.co.in/documents/15491/115033/in.gif"
                          moz-do-not-send="true" nosend="1" alt="TBS
                          Linked In" title="TBS Linked In" border="0"
                          height="25" width="25"></a> </td>
                  </tr>
                </tbody>
              </table>
              <table style="padding-left:0px; width:298px"
                valign="bottom" cellpadding="0" cellspacing="0"
                align="right" border="0">
                <tbody>
                  <tr>
                    <td style="font-size:0; line-height:0;"
                      align="right" bgcolor="#fff" valign="bottom"> <img
src="http://www.techbluesoftware.co.in/documents/15491/115033/spacer7.gif"
                        moz-do-not-send="true" alt="" height="30"
                        width="1"></td>
                  </tr>
                  <tr>
                    <td style=" margin:0; width:320px; " align="right"
                      valign="bottom"> <a
                        href="http://www.techbluesoftware.co.in"><img
src="http://www.techbluesoftware.co.in/documents/15491/115033/tech_circle.gif"
                          moz-do-not-send="true" alt="TBS Branding"
                          height="136" width="320"></a> </td>
                  </tr>
                </tbody>
              </table>
            </td>
          </tr>
          <tr>
            <td style="font-size:0; line-height:0;" align="left"
              bgcolor="#fff" valign="top"> <img
src="http://www.techbluesoftware.co.in/documents/15491/115033/spacer7.gif"
                moz-do-not-send="true" alt="" height="18" width="1"></td>
          </tr>
        </tbody>
      </table>
    </div>
  </body>
</html>