// build the column-adding SQL queries
$columns = CRM_Core_I18n_SchemaStructure::columns();
$indices = CRM_Core_I18n_SchemaStructure::indices();
// build the column-adding SQL queries
$columns = CRM_Core_I18n_SchemaStructure::columns();
$indices = CRM_Core_I18n_SchemaStructure::indices();
// build the required SQL queries
$columns = CRM_Core_I18n_SchemaStructure::columns();
$indices = CRM_Core_I18n_SchemaStructure::indices();
// build the required SQL queries
$columns = CRM_Core_I18n_SchemaStructure::columns();
$indices = CRM_Core_I18n_SchemaStructure::indices();
$dao->query("SHOW INDEX FROM $table", FALSE);
while ($dao->fetch()) {
if (preg_match('/_[a-z][a-z]_[A-Z][A-Z]$/', $dao->Key_name)) {
$dao->query("SHOW INDEX FROM $table", FALSE);
while ($dao->fetch()) {
if (preg_match('/_[a-z][a-z]_[A-Z][A-Z]$/', $dao->Key_name)) {
$version = str_ireplace(".upgrade", "", $version);
// fetch all the SchemaStructure versions we ship and sort by version
$version = str_ireplace(".upgrade", "", $version);
// fetch all the SchemaStructure versions we ship and sort by version
if (preg_match('/^SchemaStructure_([0-9a-z_]+)\.php$/', $file, $matches)) {
$schemas[] = str_replace('_', '.', $matches[1]);
}
if (preg_match('/^SchemaStructure_([0-9a-z_]+)\.php$/', $file, $matches)) {
$schemas[] = str_replace('_', '.', $matches[1]);
}
$indices =& $class::indices();
$columns =& $class::columns();
if (!isset($indices[$table])) {
$indices =& $class::indices();
$columns =& $class::columns();
if (!isset($indices[$table])) {
foreach ($indices[$table] as $index) {
$unique = isset($index['unique']) && $index['unique'] ? 'UNIQUE' : '';
foreach ($index['field'] as $i => $col) {
foreach ($indices[$table] as $index) {
$unique = isset($index['unique']) && $index['unique'] ? 'UNIQUE' : '';
foreach ($index['field'] as $i => $col) {
*/
private static function createViewQuery($locale, $table, &$dao, $class = 'CRM_Core_I18n_SchemaStructure', $isUpgradeMode = FALSE) {
$columns =& $class::columns();
*/
private static function createViewQuery($locale, $table, &$dao, $class = 'CRM_Core_I18n_SchemaStructure', $isUpgradeMode = FALSE) {
$columns =& $class::columns();
$dao->query("DESCRIBE {$table}", FALSE);
while ($dao->fetch()) {
// view non-internationalized columns directly
$dao->query("DESCRIBE {$table}", FALSE);
while ($dao->fetch()) {
// view non-internationalized columns directly
foreach ($hash as $column => $_) {
$trigger[] = "IF NEW.{$column}_{$locale} IS NOT NULL THEN";
foreach ($locales as $old) {
foreach ($hash as $column => $_) {
$trigger[] = "IF NEW.{$column}_{$locale} IS NOT NULL THEN";
foreach ($locales as $old) {