diff --git a/lib/schema.mysql.php b/lib/mysqlschema.php similarity index 100% rename from lib/schema.mysql.php rename to lib/mysqlschema.php diff --git a/lib/schema.pgsql.php b/lib/pgsqlschema.php similarity index 100% rename from lib/schema.pgsql.php rename to lib/pgsqlschema.php diff --git a/lib/schema.php b/lib/schema.php index 27a4deda11..137b814e02 100644 --- a/lib/schema.php +++ b/lib/schema.php @@ -77,14 +77,12 @@ class Schema { $type = common_config('db', 'type'); if (empty(self::$_single)) { - include "lib/schema.{$type}.php"; - $class = $type.='Schema'; - self::$_single = new $class(); + $schemaClass = ucfirst($type).'Schema'; + self::$_single = new $schemaClass(); } return self::$_single; } - /** * Gets a ColumnDef object for a single column. * @@ -475,7 +473,7 @@ class Schema } else { $sql .= ($cd->nullable) ? "null " : "not null "; } - + if (!empty($cd->auto_increment)) { $sql .= " auto_increment "; }