CiviCRM/ibfk
< CiviCRM
Denna sida hålls inte längre uppdaterad, och behålls främst av historiska skäl. Se eventuellt diskussionssidan för mer information. |
ALTER TABLE `civicrm_acl_cache` DROP FOREIGN KEY `civicrm_acl_cache_ibfk_1`; ALTER TABLE `civicrm_acl_cache` DROP FOREIGN KEY `civicrm_acl_cache_ibfk_2`; ALTER TABLE `civicrm_acl_contact_cache` DROP FOREIGN KEY `civicrm_acl_contact_cache_ibfk_1`; ALTER TABLE `civicrm_acl_contact_cache` DROP FOREIGN KEY `civicrm_acl_contact_cache_ibfk_2`; ALTER TABLE `civicrm_action_log` DROP FOREIGN KEY `civicrm_action_log_ibfk_1`; ALTER TABLE `civicrm_action_log` DROP FOREIGN KEY `civicrm_action_log_ibfk_2`; ALTER TABLE `civicrm_action_schedule` DROP FOREIGN KEY `civicrm_action_schedule_ibfk_1`; ALTER TABLE `civicrm_action_schedule` DROP FOREIGN KEY `civicrm_action_schedule_ibfk_2`; ALTER TABLE `civicrm_action_schedule` DROP FOREIGN KEY `civicrm_action_schedule_ibfk_3`; ALTER TABLE `civicrm_activity` DROP FOREIGN KEY `civicrm_activity_ibfk_1`; ALTER TABLE `civicrm_activity` DROP FOREIGN KEY `civicrm_activity_ibfk_2`; ALTER TABLE `civicrm_activity` DROP FOREIGN KEY `civicrm_activity_ibfk_3`; ALTER TABLE `civicrm_activity` DROP FOREIGN KEY `civicrm_activity_ibfk_4`; ALTER TABLE `civicrm_activity` DROP FOREIGN KEY `civicrm_activity_ibfk_5`; ALTER TABLE `civicrm_activity` DROP FOREIGN KEY `civicrm_activity_ibfk_6`; ALTER TABLE `civicrm_activity_assignment` DROP FOREIGN KEY `civicrm_activity_assignment_ibfk_1`; ALTER TABLE `civicrm_activity_target` DROP FOREIGN KEY `civicrm_activity_target_ibfk_1`; ALTER TABLE `civicrm_activity_target` DROP FOREIGN KEY `civicrm_activity_target_ibfk_2`; ALTER TABLE `civicrm_address` DROP FOREIGN KEY `civicrm_address_ibfk_1`; ALTER TABLE `civicrm_address` DROP FOREIGN KEY `civicrm_address_ibfk_2`; ALTER TABLE `civicrm_address` DROP FOREIGN KEY `civicrm_address_ibfk_3`; ALTER TABLE `civicrm_address` DROP FOREIGN KEY `civicrm_address_ibfk_4`; ALTER TABLE `civicrm_address` DROP FOREIGN KEY `civicrm_address_ibfk_5`; ALTER TABLE `civicrm_batch` DROP FOREIGN KEY `civicrm_batch_ibfk_1`; ALTER TABLE `civicrm_batch` DROP FOREIGN KEY `civicrm_batch_ibfk_2`; ALTER TABLE `civicrm_cache` DROP FOREIGN KEY `civicrm_cache_ibfk_1`; ALTER TABLE `civicrm_campaign` DROP FOREIGN KEY `civicrm_campaign_ibfk_1`; ALTER TABLE `civicrm_campaign` DROP FOREIGN KEY `civicrm_campaign_ibfk_2`; ALTER TABLE `civicrm_campaign` DROP FOREIGN KEY `civicrm_campaign_ibfk_3`; ALTER TABLE `civicrm_campaign_group` DROP FOREIGN KEY `civicrm_campaign_group_ibfk_1`; ALTER TABLE `civicrm_case_activity` DROP FOREIGN KEY `civicrm_case_activity_ibfk_1`; ALTER TABLE `civicrm_case_activity` DROP FOREIGN KEY `civicrm_case_activity_ibfk_2`; ALTER TABLE `civicrm_case_contact` DROP FOREIGN KEY `civicrm_case_contact_ibfk_1`; ALTER TABLE `civicrm_case_contact` DROP FOREIGN KEY `civicrm_case_contact_ibfk_2`; ALTER TABLE `civicrm_contact` DROP FOREIGN KEY `civicrm_contact_ibfk_1`; ALTER TABLE `civicrm_contact` DROP FOREIGN KEY `civicrm_contact_ibfk_2`; ALTER TABLE `civicrm_contact_type` DROP FOREIGN KEY `civicrm_contact_type_ibfk_1`; ALTER TABLE `civicrm_contribution` DROP FOREIGN KEY `civicrm_contribution_ibfk_1`; ALTER TABLE `civicrm_contribution` DROP FOREIGN KEY `civicrm_contribution_ibfk_2`; ALTER TABLE `civicrm_contribution` DROP FOREIGN KEY `civicrm_contribution_ibfk_3`; ALTER TABLE `civicrm_contribution` DROP FOREIGN KEY `civicrm_contribution_ibfk_4`; ALTER TABLE `civicrm_contribution` DROP FOREIGN KEY `civicrm_contribution_ibfk_5`; ALTER TABLE `civicrm_contribution` DROP FOREIGN KEY `civicrm_contribution_ibfk_6`; ALTER TABLE `civicrm_contribution` DROP FOREIGN KEY `civicrm_contribution_ibfk_7`; ALTER TABLE `civicrm_contribution_page` DROP FOREIGN KEY `civicrm_contribution_page_ibfk_1`; ALTER TABLE `civicrm_contribution_page` DROP FOREIGN KEY `civicrm_contribution_page_ibfk_2`; ALTER TABLE `civicrm_contribution_page` DROP FOREIGN KEY `civicrm_contribution_page_ibfk_3`; ALTER TABLE `civicrm_contribution_page` DROP FOREIGN KEY `civicrm_contribution_page_ibfk_4`; ALTER TABLE `civicrm_contribution_product` DROP FOREIGN KEY `civicrm_contribution_product_ibfk_1`; ALTER TABLE `civicrm_contribution_recur` DROP FOREIGN KEY `civicrm_contribution_recur_ibfk_1`; ALTER TABLE `civicrm_contribution_recur` DROP FOREIGN KEY `civicrm_contribution_recur_ibfk_2`; ALTER TABLE `civicrm_contribution_soft` DROP FOREIGN KEY `civicrm_contribution_soft_ibfk_1`; ALTER TABLE `civicrm_contribution_soft` DROP FOREIGN KEY `civicrm_contribution_soft_ibfk_2`; ALTER TABLE `civicrm_contribution_soft` DROP FOREIGN KEY `civicrm_contribution_soft_ibfk_3`; ALTER TABLE `civicrm_contribution_widget` DROP FOREIGN KEY `civicrm_contribution_widget_ibfk_1`; ALTER TABLE `civicrm_country` DROP FOREIGN KEY `civicrm_country_ibfk_1`; ALTER TABLE `civicrm_country` DROP FOREIGN KEY `civicrm_country_ibfk_2`; ALTER TABLE `civicrm_county` DROP FOREIGN KEY `civicrm_county_ibfk_1`; ALTER TABLE `civicrm_custom_field` DROP FOREIGN KEY `civicrm_custom_field_ibfk_1`; ALTER TABLE `civicrm_custom_group` DROP FOREIGN KEY `civicrm_custom_group_ibfk_1`; ALTER TABLE `civicrm_dashboard` DROP FOREIGN KEY `civicrm_dashboard_ibfk_1`; ALTER TABLE `civicrm_dashboard_contact` DROP FOREIGN KEY `civicrm_dashboard_contact_ibfk_1`; ALTER TABLE `civicrm_dashboard_contact` DROP FOREIGN KEY `civicrm_dashboard_contact_ibfk_2`; ALTER TABLE `civicrm_dedupe_exception` DROP FOREIGN KEY `civicrm_dedupe_exception_ibfk_1`; ALTER TABLE `civicrm_dedupe_exception` DROP FOREIGN KEY `civicrm_dedupe_exception_ibfk_2`; ALTER TABLE `civicrm_dedupe_rule` DROP FOREIGN KEY `civicrm_dedupe_rule_ibfk_1`; ALTER TABLE `civicrm_discount` DROP FOREIGN KEY `civicrm_discount_ibfk_1`; ALTER TABLE `civicrm_email` DROP FOREIGN KEY `civicrm_email_ibfk_1`; ALTER TABLE `civicrm_entity_batch` DROP FOREIGN KEY `civicrm_entity_batch_ibfk_1`; ALTER TABLE `civicrm_entity_file` DROP FOREIGN KEY `civicrm_entity_file_ibfk_1`; ALTER TABLE `civicrm_entity_financial_trxn` DROP FOREIGN KEY `civicrm_entity_financial_trxn_ibfk_1`; ALTER TABLE `civicrm_entity_tag` DROP FOREIGN KEY `civicrm_entity_tag_ibfk_1`; ALTER TABLE `civicrm_event` DROP FOREIGN KEY `civicrm_event_ibfk_1`; ALTER TABLE `civicrm_event` DROP FOREIGN KEY `civicrm_event_ibfk_2`; ALTER TABLE `civicrm_event` DROP FOREIGN KEY `civicrm_event_ibfk_3`; ALTER TABLE `civicrm_event` DROP FOREIGN KEY `civicrm_event_ibfk_4`; ALTER TABLE `civicrm_financial_trxn` DROP FOREIGN KEY `civicrm_financial_trxn_ibfk_1`; ALTER TABLE `civicrm_financial_trxn` DROP FOREIGN KEY `civicrm_financial_trxn_ibfk_2`; ALTER TABLE `civicrm_grant` DROP FOREIGN KEY `civicrm_grant_ibfk_1`; ALTER TABLE `civicrm_group` DROP FOREIGN KEY `civicrm_group_ibfk_1`; ALTER TABLE `civicrm_group_contact` DROP FOREIGN KEY `civicrm_group_contact_ibfk_1`; ALTER TABLE `civicrm_group_contact` DROP FOREIGN KEY `civicrm_group_contact_ibfk_2`; ALTER TABLE `civicrm_group_contact` DROP FOREIGN KEY `civicrm_group_contact_ibfk_3`; ALTER TABLE `civicrm_group_contact` DROP FOREIGN KEY `civicrm_group_contact_ibfk_4`; ALTER TABLE `civicrm_group_contact_cache` DROP FOREIGN KEY `civicrm_group_contact_cache_ibfk_1`; ALTER TABLE `civicrm_group_contact_cache` DROP FOREIGN KEY `civicrm_group_contact_cache_ibfk_2`; ALTER TABLE `civicrm_group_nesting` DROP FOREIGN KEY `civicrm_group_nesting_ibfk_1`; ALTER TABLE `civicrm_group_nesting` DROP FOREIGN KEY `civicrm_group_nesting_ibfk_2`; ALTER TABLE `civicrm_group_organization` DROP FOREIGN KEY `civicrm_group_organization_ibfk_1`; ALTER TABLE `civicrm_group_organization` DROP FOREIGN KEY `civicrm_group_organization_ibfk_2`; ALTER TABLE `civicrm_im` DROP FOREIGN KEY `civicrm_im_ibfk_1`; ALTER TABLE `civicrm_line_item` DROP FOREIGN KEY `civicrm_line_item_ibfk_1`; ALTER TABLE `civicrm_line_item` DROP FOREIGN KEY `civicrm_line_item_ibfk_2`; ALTER TABLE `civicrm_loc_block` DROP FOREIGN KEY `civicrm_loc_block_ibfk_1`; ALTER TABLE `civicrm_loc_block` DROP FOREIGN KEY `civicrm_loc_block_ibfk_2`; ALTER TABLE `civicrm_loc_block` DROP FOREIGN KEY `civicrm_loc_block_ibfk_3`; ALTER TABLE `civicrm_loc_block` DROP FOREIGN KEY `civicrm_loc_block_ibfk_4`; ALTER TABLE `civicrm_loc_block` DROP FOREIGN KEY `civicrm_loc_block_ibfk_5`; ALTER TABLE `civicrm_loc_block` DROP FOREIGN KEY `civicrm_loc_block_ibfk_6`; ALTER TABLE `civicrm_loc_block` DROP FOREIGN KEY `civicrm_loc_block_ibfk_7`; ALTER TABLE `civicrm_loc_block` DROP FOREIGN KEY `civicrm_loc_block_ibfk_8`; ALTER TABLE `civicrm_log` DROP FOREIGN KEY `civicrm_log_ibfk_1`; ALTER TABLE `civicrm_mailing` DROP FOREIGN KEY `civicrm_mailing_ibfk_1`; ALTER TABLE `civicrm_mailing` DROP FOREIGN KEY `civicrm_mailing_ibfk_10`; ALTER TABLE `civicrm_mailing` DROP FOREIGN KEY `civicrm_mailing_ibfk_11`; ALTER TABLE `civicrm_mailing` DROP FOREIGN KEY `civicrm_mailing_ibfk_2`; ALTER TABLE `civicrm_mailing` DROP FOREIGN KEY `civicrm_mailing_ibfk_3`; ALTER TABLE `civicrm_mailing` DROP FOREIGN KEY `civicrm_mailing_ibfk_4`; ALTER TABLE `civicrm_mailing` DROP FOREIGN KEY `civicrm_mailing_ibfk_5`; ALTER TABLE `civicrm_mailing` DROP FOREIGN KEY `civicrm_mailing_ibfk_6`; ALTER TABLE `civicrm_mailing` DROP FOREIGN KEY `civicrm_mailing_ibfk_7`; ALTER TABLE `civicrm_mailing` DROP FOREIGN KEY `civicrm_mailing_ibfk_8`; ALTER TABLE `civicrm_mailing` DROP FOREIGN KEY `civicrm_mailing_ibfk_9`; ALTER TABLE `civicrm_mailing_bounce_pattern` DROP FOREIGN KEY `civicrm_mailing_bounce_pattern_ibfk_1`; ALTER TABLE `civicrm_mailing_event_bounce` DROP FOREIGN KEY `civicrm_mailing_event_bounce_ibfk_1`; ALTER TABLE `civicrm_mailing_event_confirm` DROP FOREIGN KEY `civicrm_mailing_event_confirm_ibfk_1`; ALTER TABLE `civicrm_mailing_event_delivered` DROP FOREIGN KEY `civicrm_mailing_event_delivered_ibfk_1`; ALTER TABLE `civicrm_mailing_event_forward` DROP FOREIGN KEY `civicrm_mailing_event_forward_ibfk_1`; ALTER TABLE `civicrm_mailing_event_forward` DROP FOREIGN KEY `civicrm_mailing_event_forward_ibfk_2`; ALTER TABLE `civicrm_mailing_event_opened` DROP FOREIGN KEY `civicrm_mailing_event_opened_ibfk_1`; ALTER TABLE `civicrm_mailing_event_queue` DROP FOREIGN KEY `civicrm_mailing_event_queue_ibfk_1`; ALTER TABLE `civicrm_mailing_event_queue` DROP FOREIGN KEY `civicrm_mailing_event_queue_ibfk_2`; ALTER TABLE `civicrm_mailing_event_queue` DROP FOREIGN KEY `civicrm_mailing_event_queue_ibfk_3`; ALTER TABLE `civicrm_mailing_event_reply` DROP FOREIGN KEY `civicrm_mailing_event_reply_ibfk_1`; ALTER TABLE `civicrm_mailing_event_subscribe` DROP FOREIGN KEY `civicrm_mailing_event_subscribe_ibfk_1`; ALTER TABLE `civicrm_mailing_event_subscribe` DROP FOREIGN KEY `civicrm_mailing_event_subscribe_ibfk_2`; ALTER TABLE `civicrm_mailing_event_trackable_url_open` DROP FOREIGN KEY `civicrm_mailing_event_trackable_url_open_ibfk_1`; ALTER TABLE `civicrm_mailing_event_trackable_url_open` DROP FOREIGN KEY `civicrm_mailing_event_trackable_url_open_ibfk_2`; ALTER TABLE `civicrm_mailing_event_unsubscribe` DROP FOREIGN KEY `civicrm_mailing_event_unsubscribe_ibfk_1`; ALTER TABLE `civicrm_mailing_group` DROP FOREIGN KEY `civicrm_mailing_group_ibfk_1`; ALTER TABLE `civicrm_mailing_job` DROP FOREIGN KEY `civicrm_mailing_job_ibfk_1`; ALTER TABLE `civicrm_mailing_job` DROP FOREIGN KEY `civicrm_mailing_job_ibfk_2`; ALTER TABLE `civicrm_mailing_recipients` DROP FOREIGN KEY `civicrm_mailing_recipients_ibfk_1`; ALTER TABLE `civicrm_mailing_recipients` DROP FOREIGN KEY `civicrm_mailing_recipients_ibfk_2`; ALTER TABLE `civicrm_mailing_recipients` DROP FOREIGN KEY `civicrm_mailing_recipients_ibfk_3`; ALTER TABLE `civicrm_mailing_spool` DROP FOREIGN KEY `civicrm_mailing_spool_ibfk_1`; ALTER TABLE `civicrm_mailing_trackable_url` DROP FOREIGN KEY `civicrm_mailing_trackable_url_ibfk_1`; ALTER TABLE `civicrm_mapping_field` DROP FOREIGN KEY `civicrm_mapping_field_ibfk_1`; ALTER TABLE `civicrm_mapping_field` DROP FOREIGN KEY `civicrm_mapping_field_ibfk_2`; ALTER TABLE `civicrm_mapping_field` DROP FOREIGN KEY `civicrm_mapping_field_ibfk_3`; ALTER TABLE `civicrm_membership` DROP FOREIGN KEY `civicrm_membership_ibfk_1`; ALTER TABLE `civicrm_membership` DROP FOREIGN KEY `civicrm_membership_ibfk_2`; ALTER TABLE `civicrm_membership` DROP FOREIGN KEY `civicrm_membership_ibfk_3`; ALTER TABLE `civicrm_membership` DROP FOREIGN KEY `civicrm_membership_ibfk_4`; ALTER TABLE `civicrm_membership` DROP FOREIGN KEY `civicrm_membership_ibfk_5`; ALTER TABLE `civicrm_membership` DROP FOREIGN KEY `civicrm_membership_ibfk_6`; ALTER TABLE `civicrm_membership_block` DROP FOREIGN KEY `civicrm_membership_block_ibfk_1`; ALTER TABLE `civicrm_membership_block` DROP FOREIGN KEY `civicrm_membership_block_ibfk_2`; ALTER TABLE `civicrm_membership_log` DROP FOREIGN KEY `civicrm_membership_log_ibfk_1`; ALTER TABLE `civicrm_membership_log` DROP FOREIGN KEY `civicrm_membership_log_ibfk_2`; ALTER TABLE `civicrm_membership_log` DROP FOREIGN KEY `civicrm_membership_log_ibfk_3`; ALTER TABLE `civicrm_membership_payment` DROP FOREIGN KEY `civicrm_membership_payment_ibfk_1`; ALTER TABLE `civicrm_membership_type` DROP FOREIGN KEY `civicrm_membership_type_ibfk_1`; ALTER TABLE `civicrm_membership_type` DROP FOREIGN KEY `civicrm_membership_type_ibfk_2`; ALTER TABLE `civicrm_membership_type` DROP FOREIGN KEY `civicrm_membership_type_ibfk_3`; ALTER TABLE `civicrm_membership_type` DROP FOREIGN KEY `civicrm_membership_type_ibfk_4`; ALTER TABLE `civicrm_membership_type` DROP FOREIGN KEY `civicrm_membership_type_ibfk_5`; ALTER TABLE `civicrm_menu` DROP FOREIGN KEY `civicrm_menu_ibfk_1`; ALTER TABLE `civicrm_menu` DROP FOREIGN KEY `civicrm_menu_ibfk_2`; ALTER TABLE `civicrm_msg_template` DROP FOREIGN KEY `civicrm_msg_template_ibfk_1`; ALTER TABLE `civicrm_navigation` DROP FOREIGN KEY `civicrm_navigation_ibfk_1`; ALTER TABLE `civicrm_navigation` DROP FOREIGN KEY `civicrm_navigation_ibfk_2`; ALTER TABLE `civicrm_note` DROP FOREIGN KEY `civicrm_note_ibfk_1`; ALTER TABLE `civicrm_openid` DROP FOREIGN KEY `civicrm_openid_ibfk_1`; ALTER TABLE `civicrm_option_value` DROP FOREIGN KEY `civicrm_option_value_ibfk_1`; ALTER TABLE `civicrm_option_value` DROP FOREIGN KEY `civicrm_option_value_ibfk_2`; ALTER TABLE `civicrm_option_value` DROP FOREIGN KEY `civicrm_option_value_ibfk_3`; ALTER TABLE `civicrm_participant` DROP FOREIGN KEY `civicrm_participant_ibfk_1`; ALTER TABLE `civicrm_participant` DROP FOREIGN KEY `civicrm_participant_ibfk_2`; ALTER TABLE `civicrm_participant` DROP FOREIGN KEY `civicrm_participant_ibfk_3`; ALTER TABLE `civicrm_participant` DROP FOREIGN KEY `civicrm_participant_ibfk_4`; ALTER TABLE `civicrm_participant` DROP FOREIGN KEY `civicrm_participant_ibfk_5`; ALTER TABLE `civicrm_participant` DROP FOREIGN KEY `civicrm_participant_ibfk_6`; ALTER TABLE `civicrm_participant_payment` DROP FOREIGN KEY `civicrm_participant_payment_ibfk_1`; ALTER TABLE `civicrm_participant_payment` DROP FOREIGN KEY `civicrm_participant_payment_ibfk_2`; ALTER TABLE `civicrm_payment_processor` DROP FOREIGN KEY `civicrm_payment_processor_ibfk_1`; ALTER TABLE `civicrm_pledge` ADD CONSTRAINT `FK_civicrm_pledge_campaign_id` FOREIGN KEY (`campaign_id`) REFERENCES `civicrm_campaign` (`id`) ON DELETE SET NULL; ALTER TABLE `civicrm_pledge` ADD CONSTRAINT `FK_civicrm_pledge_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE; ALTER TABLE `civicrm_pledge` ADD CONSTRAINT `FK_civicrm_pledge_contribution_page_id` FOREIGN KEY (`contribution_page_id`) REFERENCES `civicrm_contribution_page` (`id`) ON DELETE SET NULL; ALTER TABLE `civicrm_pledge` ADD CONSTRAINT `FK_civicrm_pledge_contribution_type_id` FOREIGN KEY (`contribution_type_id`) REFERENCES `civicrm_contribution_type` (`id`) ON DELETE SET NULL; ALTER TABLE `civicrm_pledge` ADD CONSTRAINT `FK_civicrm_pledge_honor_contact_id` FOREIGN KEY (`honor_contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL; ALTER TABLE `civicrm_price_set` ADD CONSTRAINT `FK_civicrm_price_set_contribution_type_id` FOREIGN KEY (`contribution_type_id`) REFERENCES `civicrm_contribution_type` (`id`) ON DELETE SET NULL; ALTER TABLE `civicrm_price_set` ADD CONSTRAINT `FK_civicrm_price_set_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`); UPDATE `civicrm_contribution_type` SET `name` = 'Event Fee' WHERE `civicrm_contribution_type`.`id` =4;
+++ ../all/modules/civicrm/CRM/Logging/Schema.php (working copy) @@ -367,7 +367,7 @@ $suppressLoggingCond = "@civicrm_disable_logging IS NULL OR @civicrm_disable_logging = 0"; $updateSQL = "IF ( (" . implode( ' OR ', $cond ) . ") AND ( $suppressLoggingCond ) ) THEN "; - $sqlStmt = "INSERT INTO `{$this->db}`.log_{tableName} ("; + $sqlStmt = "INSERT INTO log_{tableName} ("; foreach ($columns as $column) { $sqlStmt .= "$column, "; }