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) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Master-Slave mysql installs must have auto_increment of 1
Pages: [1]

Author Topic: Master-Slave mysql installs must have auto_increment of 1  (Read 1814 times)

amazon

  • Guest
Master-Slave mysql installs must have auto_increment of 1
August 04, 2007, 03:51:01 pm
Hi, we just tried to use CiviCRM 1.8B in someone else's master master MySQL environment.  Got this error do due auto-incrementing not being 1:

ERROR 1452 (23000) at line 4435: Cannot add or update a child row: a foreign key constraint fails (`association_civicrm/civicrm_mailing_bounce_pattern`, CONSTRAINT `FK_civicrm_mailing_bounce_pattern_bounce_type_id` FOREIGN KEY (`bounce_type_id`) REFERENCES `civicrm_mailing_bounce_type` (`id)

this led to failure to add bounce_type_ids.  From our research, CiviCRM will not support auto-increments other than one.

Cheers,
Kieran

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Master-Slave mysql installs must have auto_increment of 1
August 04, 2007, 08:51:24 pm

This is not a bug in the code per se, but more a function of how we create the data file and our assumption of auto-incremene being one for all installs (any specific reason why u have a non-1 auto-increment)

here is the relevant sql code from civicrm_data.mysql:

-- Bounce classification patterns
INSERT INTO civicrm_mailing_bounce_type
        (name, description, hold_threshold)
        VALUES ('AOL', 'AOL Terms of Service complaint', 1);
INSERT INTO civicrm_mailing_bounce_pattern
        (bounce_type_id, pattern)
        VALUES
    (1, 'Client TOS Notification');


The second insert assumes that the first one was inserted at id 1. we can get around this by making the logic a wee bit more complex. We've been doing this in the recent past.

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Master-Slave mysql installs must have auto_increment of 1

This forum was archived on 2017-11-26.