CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 4.1 Release Testing (Moderator: Kurund Jalmi) »
  • Joomla 3.4.7 > 4.1beta1 DB upgrade
Pages: [1]

Author Topic: Joomla 3.4.7 > 4.1beta1 DB upgrade  (Read 1336 times)

speleo

  • Ask me questions
  • ****
  • Posts: 396
  • Karma: 28
  • CiviCRM version: 4.3.1
  • CMS version: J! 2.5,9
  • MySQL version: 5.1
  • PHP version: 5.3.24
Joomla 3.4.7 > 4.1beta1 DB upgrade
December 24, 2011, 01:38:34 am
It may well be that my db was a little borked in the first place as I've been thru a lot of upgrades (and haven't done a schema integrity for 6 months) ..... but.....


Code: [Select]
Sorry. A non-recoverable error has occurred.

DB Error: unknown error
Error Details
Database Error Code: Error on rename of './my_db_name/civicrm_pcp_block' to './my_db_name/#sql2-45cf-ce31d' (errno: 152), 1025
Additional Details:
Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )
[code] => -1
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] => ALTER TABLE civicrm_pcp_block
      DROP FOREIGN KEY FK_civicrm_pcp_block_entity_id,
      DROP INDEX FK_civicrm_pcp_block_entity_id [nativecode=1025 ** Error on rename of './my_db_name/civicrm_pcp_block' to './my_db_name/#sql2-45cf-ce31d' (errno: 152)]
    [type] => DB_Error
    [user_info] => ALTER TABLE civicrm_pcp_block
      DROP FOREIGN KEY FK_civicrm_pcp_block_entity_id,
      DROP INDEX FK_civicrm_pcp_block_entity_id [nativecode=1025 ** Error on rename of './my_db_name/civicrm_pcp_block' to './my_db_name/#sql2-45cf-ce31d' (errno: 152)]
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="ALTER TABLE civicrm_pcp_block
      DROP FOREIGN KEY FK_civicrm_pcp_block_entity_id,
      DROP INDEX FK_civicrm_pcp_block_entity_id [nativecode=1025 ** Error on rename of './my_db_name/civicrm_pcp_block' to './my_db_name/#sql2-45cf-ce31d' (errno: 152)]"]
)

There is also an issue with the PCP table.

With a copy of the original old db, I got around this by dropping the two tables (mine were empty as I don't use PCP - you might want to export / import)

        SET FOREIGN_KEY_CHECKS=0;
        DROP TABLE IF EXISTS civicrm_pcp;
        DROP TABLE IF EXISTS civicrm_pcp_block;
        SET FOREIGN_KEY_CHECKS=1;

I then downloaded a copy of 4.08 and grabbed the table creation code for those two tables from \com_civicrm\admin\civicrm\sql\civicrm.mysql and ran it against the db to create the tables.

Did all of this in phpMyAdmin and then ran

http://www.my site.com/dev/administrator/?option=com_civicrm&task=civicrm/upgrade&reset=1

Gets around the problem but think this might be a bug in the upgrade code.

Deepak Srivastava

  • Ask me questions
  • ****
  • Posts: 677
  • Karma: 65
Re: Joomla 3.4.7 > 4.1beta1 DB upgrade
December 25, 2011, 09:16:38 pm
Henry, thanks for the info.

Did you verify if other tables had FKs present ?

I tried verifying at some of our old installs but they did have FKs present (related to civicrm_pcp_block). Also looked at upgrade queries for pcp_block history.
Haven't received any other such reports so we 'll wait a bit before we make it conditional.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

speleo

  • Ask me questions
  • ****
  • Posts: 396
  • Karma: 28
  • CiviCRM version: 4.3.1
  • CMS version: J! 2.5,9
  • MySQL version: 5.1
  • PHP version: 5.3.24
Re: Joomla 3.4.7 > 4.1beta1 DB upgrade
December 26, 2011, 12:48:00 am
Hi Deepak,

To be honest I didn't look at the FK in other tables.  I just took a dump of the 3.47 table (as I'm still live on it) and the structure is

Code: [Select]
[quote]CREATE TABLE `civicrm_pcp_block` (
  `id` int(10) unsigned NOT NULL auto_increment COMMENT 'PCP block Id',
  `entity_table` varchar(64) collate utf8_unicode_ci default NULL,
  `entity_id` int(10) unsigned NOT NULL COMMENT 'FK to civicrm_contribution_page.id',
  `supporter_profile_id` int(10) unsigned default NULL COMMENT 'FK to civicrm_uf_group.id. Does Personal Campaign Page require manual activation by administrator? (is inactive by default after setup)?',
  `is_approval_needed` tinyint(4) default NULL COMMENT 'Does Personal Campaign Page require manual activation by administrator? (is inactive by default after setup)?',
  `is_tellfriend_enabled` tinyint(4) default NULL COMMENT 'Does Personal Campaign Page allow using tell a friend?',
  `tellfriend_limit` int(10) unsigned default NULL COMMENT 'Maximum recipient fields allowed in tell a friend',
  `link_text` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Link text for PCP.',
  `is_active` tinyint(4) default '1' COMMENT 'Is Personal Campaign Page Block enabled/active?',
  `notify_email` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'If set, notification is automatically emailed to this email-address on create/update Personal Campaign Page',
  PRIMARY KEY  (`id`),
  KEY `FK_civicrm_pcp_block_entity_id` (`entity_id`),
  KEY `FK_civicrm_pcp_block_supporter_profile_id` (`supporter_profile_id`),
  CONSTRAINT `FK_civicrm_pcp_block_entity_id` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_contribution_page` (`id`),
  CONSTRAINT `FK_civicrm_pcp_block_supporter_profile_id` FOREIGN KEY (`supporter_profile_id`) REFERENCES `civicrm_uf_group` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;[/quote]

but there is no data in the table. 

Purely for the purposes of this conversation I could send the db for you to take a look at. PM me if you want this.

Henry

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 4.1 Release Testing (Moderator: Kurund Jalmi) »
  • Joomla 3.4.7 > 4.1beta1 DB upgrade

This forum was archived on 2017-11-26.