]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/mysqlschema.php
Filter table definitions to scrub out unsupported features before trying to alter...
[quix0rs-gnu-social.git] / lib / mysqlschema.php
index 688bea3e2b2d39e1f01a5e173b2d74fab7b1f562..eeabae8cd37c59d1f2ebba8b31756b16ebb3ceca 100644 (file)
@@ -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;
+    }
 }