Skip to content

Instantly share code, notes, and snippets.

View axon-obriend's full-sized avatar

Dan O'Brien axon-obriend

  • George Mason University
  • Fairfax, VA
View GitHub Profile
SET foreign_key_checks='OFF';
ALTER TABLE civicrm_prevnext_cache DROP INDEX index_all;
ALTER TABLE civicrm_prevnext_cache ADD INDEX index_all (cacheKey, entity_id1, entity_id2, entity_table, is_selected);
ALTER TABLE civicrm_contact ADD INDEX index_is_deceased (is_deceased);
ALTER TABLE civicrm_entity_financial_account ADD UNIQUE INDEX index_entity_id_entity_table_account_relationship (entity_id, entity_table, account_relationship);
ALTER TABLE civicrm_option_value DROP FOREIGN KEY FK_civicrm_option_value_option_group_id;
@axon-obriend
axon-obriend / civimail-template-diffs
Created October 17, 2017 14:27
Compare any modified CiviCRM workflow templates to the originals
#!/usr/bin/env bash
set -x
test -d ./default && rm -rf ./default
mkdir ./default
test -d ./modified && rm -rf ./modified
mkdir ./modified
TID=`mysql --skip-column-names --database=civicrm -e "
SELECT workflow_id
FROM civicrm_msg_template
#!/bin/bash
# Script uses LibreOffice Calc in headless mode to convert a tab-separated values file
# to a comma-separated values file. Also replaces MySQL NULLs with empty string.
if [[ $# -ne 1 ]]; then
echo "usage: `basename $0` filename"
echo "where 'filename' is a file of tab-separated values. 'filename' will be converted"
echo "to comma-separated values and renamed 'filename.bak'."
exit 1
fi
LIBRE_PATH=`which scalc`