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 »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • SOLVED - Missing Table - Can't get it to insert back in
Pages: [1]

Author Topic: SOLVED - Missing Table - Can't get it to insert back in  (Read 630 times)

stovpow

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
  • CiviCRM version: 4
  • CMS version: Drupal 7.8
  • MySQL version: 5.2
  • PHP version: 5.3.8
SOLVED - Missing Table - Can't get it to insert back in
January 02, 2014, 11:50:36 am
My installation says, and I have verified that, civicrm_acl_cache_contact is missing from the database tables. I have tried and tried to insert the following code into the database but I get an error every time:

Code: [Select]
CREATE TABLE IF NOT EXISTS `civicrm_acl_contact_cache` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'primary key',
  `user_id` int(10) unsigned DEFAULT NULL COMMENT 'FK to civicrm_contact (could be null for anon user)',
  `contact_id` int(10) unsigned NOT NULL COMMENT 'FK to civicrm_contact',
  `operation` enum('All','View','Edit','Create','Delete','Grant','Revoke') COLLATE utf8_unicode_ci NOT NULL COMMENT 'What operation does this user have permission on?',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UI_user_contact_operation` (`user_id`,`contact_id`,`operation`),
  KEY `FK_civicrm_acl_contact_cache_contact_id` (`contact_id`),
  CONSTRAINT `FK_civicrm_acl_contact_cache_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE,
  CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

I have tried adding SET FOREIGN_KEY_CHECKS=0 before the code and 1 after the code but to no avail. Any ideas on how to fix my problem? This is a Drupal installation and I am getting errors all over the website because of it.
« Last Edit: January 04, 2014, 01:48:33 pm by stovpow »

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: Missing Table - Can't get it to insert back in
January 02, 2014, 08:49:28 pm

what error do u get?

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

stovpow

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
  • CiviCRM version: 4
  • CMS version: Drupal 7.8
  • MySQL version: 5.2
  • PHP version: 5.3.8
Re: Missing Table - Can't get it to insert back in
January 03, 2014, 05:12:39 am
An empty results set has been returned - this is if I try an run a SQL query. If I try and upload it, I get:

Code: [Select]
{"redirectUrl":null,"reload":null,"refresh":true,"notifications":[{"type":"error","title":"Executing query failed","message":"Can't create table 'xxxxxxx_0.civicrm_acl_contact_cache' (errno: -1)  1005","code":"CREATE TABLE `civicrm_acl_contact_cache` (   `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMEN...","options":false}],"data":{"error":true},"js":["sideBar.loadTables(\"xxxxxx_0\")"]}
« Last Edit: January 03, 2014, 08:22:12 am by stovpow »

alexeightsix

  • I’m new here
  • *
  • Posts: 19
  • Karma: 0
  • CiviCRM version: 4.3
  • CMS version: 3.5.1
  • MySQL version: latest
  • PHP version: latest
Re: SOLVED - Missing Table - Can't get it to insert back in
November 24, 2014, 10:05:43 am
Were you able to solve this issue?

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • SOLVED - Missing Table - Can't get it to insert back in

This forum was archived on 2017-11-26.