From 229c7726344714187dad2641879cb9c4211cc85d Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 13 Oct 2010 16:04:28 -0700 Subject: Filter table definitions to scrub out unsupported features before trying to alter a table. This lets us skip those where we end up trying to change unsupported features. --- lib/mysqlschema.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/mysqlschema.php') diff --git a/lib/mysqlschema.php b/lib/mysqlschema.php index 688bea3e2..eeabae8cd 100644 --- a/lib/mysqlschema.php +++ b/lib/mysqlschema.php @@ -523,4 +523,20 @@ class MysqlSchema extends Schema return parent::typeAndSize($column); } } + + /** + * Filter the given table definition array to match features available + * in this database. + * + * This lets us strip out unsupported things like comments, foreign keys, + * or type variants that we wouldn't get back from getTableDef(). + * + * @param array $tableDef + */ + function filterDef(array $tableDef) + { + // @fixme add foreign-key support for MySQL + unset($tableDef['foreign keys']); + return $tableDef; + } } -- cgit v1.2.3-54-g00ecf