]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
$config['db']['mysql_foreign_keys'] option to experimentally enable foreign keys...
authorBrion Vibber <brion@pobox.com>
Tue, 19 Oct 2010 19:11:49 +0000 (12:11 -0700)
committerBrion Vibber <brion@pobox.com>
Tue, 19 Oct 2010 19:11:49 +0000 (12:11 -0700)
lib/default.php
lib/mysqlschema.php

index a1dac7b5e1110590d5d01b9c9deb5ba5954b5e0b..26b872da4b82c0055d385e38d059eb20afa8146b 100644 (file)
@@ -75,7 +75,8 @@ $default =
               'schemacheck' => 'runtime', // 'runtime' or 'script'
               'annotate_queries' => false, // true to add caller comments to queries, eg /* POST Notice::saveNew */
               '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' =>
         array('appname' => 'statusnet', # for syslog
               'priority' => 'debug', # XXX: currently ignored
index b21008518bfea250cb4ef9403b303a4248f7ebc9..937c20ea8baa87fd4be049fed5b4b95b09790acc 100644 (file)
@@ -400,8 +400,9 @@ class MysqlSchema extends Schema
             $col['type'] = $this->mapType($col);
             unset($col['size']);
         }
-        // @fixme add foreign-key support for MySQL
-        unset($tableDef['foreign keys']);
+        if (!common_config('db', 'mysql_foreign_keys')) {
+            unset($tableDef['foreign keys']);
+        }
         return $tableDef;
     }
 }