summaryrefslogtreecommitdiff
path: root/lib/mysqlschema.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-10-13 16:04:28 -0700
committerBrion Vibber <brion@pobox.com>2010-10-13 16:04:28 -0700
commit229c7726344714187dad2641879cb9c4211cc85d (patch)
tree54e732c0576b0aaeb0479ad785824ec2e9468d86 /lib/mysqlschema.php
parent4101de7dd7cf059816c29c666c816f260a84c252 (diff)
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.
Diffstat (limited to 'lib/mysqlschema.php')
-rw-r--r--lib/mysqlschema.php16
1 files changed, 16 insertions, 0 deletions
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;
+ }
}