BUGFIX: FulltextSearchable::enable() needs to replace the static on the decorated class iff the database engine is for MySQL

This commit is contained in:
Simon Welsh 2011-10-29 16:48:09 +13:00
parent f976af78be
commit 25602811f2

View File

@ -49,6 +49,9 @@ class FulltextSearchable extends DataExtension {
if(!class_exists($class)) continue; if(!class_exists($class)) continue;
if(isset($defaultColumns[$class])) { if(isset($defaultColumns[$class])) {
if(DB::getConn()->getDatabaseServer() == 'mysql') {
Object::add_static_var($class, 'create_table_options', array('MySQLDatabase' => 'ENGINE=MyISAM'), true);
}
Object::add_extension($class, "FulltextSearchable('{$defaultColumns[$class]}')"); Object::add_extension($class, "FulltextSearchable('{$defaultColumns[$class]}')");
} else { } else {
throw new Exception("FulltextSearchable::enable() I don't know the default search columns for class '$class'"); throw new Exception("FulltextSearchable::enable() I don't know the default search columns for class '$class'");