[Hamara-devel] Fwd: Re: Upgrade to 5.0 - Problem dropping foreign key

Anant anant.saraswat at techblue.co.uk
Thu Sep 3 05:02:44 BST 2015


at bottom:-
On Wednesday 02 September 2015 04:01 PM, shirish wrote:
>
>
>
> -------- Forwarded Message --------
> Subject: Re: Upgrade to 5.0 - Problem dropping foreign key
> Date: Fri, 10 Jul 2015 18:45:04 +0200
> From: Thorsten Schöning <tschoening at am-soft.de>
> Organization: AM-SoFT IT-Systeme
> To: support-bugzilla at lists.mozilla.org
> <support-bugzilla at lists.mozilla.org>
>
> Guten Tag Jonathan Goldberg,
> am Freitag, 10. Juli 2015 um 17:33 schrieben Sie:
>
>> Some years ago, we experimented
>> with Testopia, but never actually used it.
>
> Would have been better to use a different installation...
>
>>  We don't do any
>> customization, so I always upgrade Bugzilla using the tar ball.
>> This should overwrite any patching of Bugzilla files that the
>> Testopia installation does.  I have also dropped all of the "test_*"
>> tables from the database.
>
> Bugzilla manages the current state of its schema in the table
> bz_schema, just dropping tables is not enough. Extensions like those
> for Testopia can register themself for changing the schema and are
> added to bz_schema representation that way, so Bugzilla is always
> aware that it might need to do additional things during upgrades for
> the extensions. The interesting thing is how to completely uninstall
> extensions, so they are removed from the schema as well. From what I
> know there's currently no proper way to do this, the only thing I'm
> aware of is disabling an extension. Removing from the schema is a
> heavy task of course, the user might loose data from the extension and
> such...
>
> So to make a long story short, you need to change the content of
> bz_schema as well and remove everything testopia added. The structure
> is a simple Perl hash, easy readable in any text editor. Get it from
> the table, change it, update it or something like that, depends on the
> tools you have. You can compare it with a fresh empty installation of
> 4.4.9, shouldn't be too hard to find the differences using some diff
> tool.
>
> Because you already dropped the testopia tables, installing it again
> and just disabling it won't help you, because installation surely will
> fail. But it may be worth a try...
>
> Mit freundlichen Grüßen,
>
> Thorsten Schöning
>
@Shirish : Thanks for the help, But I have already gone through this
page. :-)

Let me tell you what I have tried.

1. Removed bz_schema and "test_*" tables from the database.
2. Only dropped "test_*" tables from the database.
3. Removed all foreign key relation from "test_*" tables.
4. Removed Testopia from extensions.
5. Changed bz_schema and removed "test_*" tables.

But still no luck

/DBD::mysql::db do failed: Can't create table
'hamarabugzilla.#sql-65f_de' (errno: 150) [for Statement "ALTER TABLE
test_case_components ADD
     CONSTRAINT fk_test_case_components_component_id_components_id
FOREIGN KEY (component_id)
     REFERENCES components(id)
      ON UPDATE CASCADE ON DELETE CASCADE"] at Bugzilla/DB.pm line 642.
    Bugzilla::DB::bz_add_fks('Bugzilla::DB::Mysql=HASH(0x77e9e40)',
'test_case_components', 'HASH(0x6d0da18)', 'HASH(0xb076038)') called at
Bugzilla/DB.pm line 546
   
Bugzilla::DB::bz_setup_foreign_keys('Bugzilla::DB::Mysql=HASH(0x77e9e40)')
called at Bugzilla/Install/DB.pm line 745
    Bugzilla::Install::DB::update_table_definitions('HASH(0x20e0358)')
called at ./checksetup.pl line 172/

Thanks,
Anant
-- 
	Anant Saraswat

System Administrator

	Direct: +91 124 4548387
Tel: +91 124 4548383 Ext- 1018
UK: +44 845 0047 142 Ext- 5020

	TBS Website <http://www.techbluesoftware.co.in>
	Techblue Software Pvt. Ltd
The Palms, Plot No 73, Sector 5, IMT Manesar,
Gurgaon- 122050 (Hr.)

www.techbluesoftware.co.in <http://www.techbluesoftware.co.in>

	
	TBS Facebook
<https://www.facebook.com/pages/Techblue-Software-Limited/441777369284888>
TBS Twitter <https://twitter.com/TechbluSoftware> TBS Google+
<https://plus.google.com/+TechblueSoftwareCoIn> TBS Linked In
<https://www.linkedin.com/company/techblue-softwares-pvt-ltd>

TBS Branding <http://www.techbluesoftware.co.in>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hamaralinux.org/pipermail/hamara-devel/attachments/20150903/627a9d7b/attachment.html>


More information about the Hamara-devel mailing list