$config['db']['mysql_foreign_keys'] option to experimentally enable foreign keys on MySQL. (Would only work on InnoDB tables, may explode, etc)

This commit is contained in:
Brion Vibber 2010-10-19 12:11:49 -07:00
parent 7751d455de
commit e07254d15b
2 changed files with 5 additions and 3 deletions

View File

@ -75,7 +75,8 @@ $default =
'schemacheck' => 'runtime', // 'runtime' or 'script' 'schemacheck' => 'runtime', // 'runtime' or 'script'
'annotate_queries' => false, // true to add caller comments to queries, eg /* POST Notice::saveNew */ 'annotate_queries' => false, // true to add caller comments to queries, eg /* POST Notice::saveNew */
'log_queries' => false, // true to log all DB queries 'log_queries' => false, // true to log all DB queries
'log_slow_queries' => 0), // if set, log queries taking over N seconds 'log_slow_queries' => 0, // if set, log queries taking over N seconds
'mysql_foreign_keys' => false), // if set, enables experimental foreign key support on MySQL
'syslog' => 'syslog' =>
array('appname' => 'statusnet', # for syslog array('appname' => 'statusnet', # for syslog
'priority' => 'debug', # XXX: currently ignored 'priority' => 'debug', # XXX: currently ignored

View File

@ -400,8 +400,9 @@ class MysqlSchema extends Schema
$col['type'] = $this->mapType($col); $col['type'] = $this->mapType($col);
unset($col['size']); unset($col['size']);
} }
// @fixme add foreign-key support for MySQL if (!common_config('db', 'mysql_foreign_keys')) {
unset($tableDef['foreign keys']); unset($tableDef['foreign keys']);
}
return $tableDef; return $tableDef;
} }
} }