Skip to content

Commit

Permalink
Merge pull request #2 from noahm/no-deprecated-type
Browse files Browse the repository at this point in the history
Use ENGINE instead of the deprecated TYPE option
  • Loading branch information
nickinuse committed Aug 4, 2011
2 parents 6d6c5ce + 1321d29 commit 796152f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions migrate.php
Expand Up @@ -223,7 +223,7 @@ function _clear_options() {
* <tt>primary_key</tt> what column name to use for primary key instead of the default `id`
* <tt>temporary</tt> whether the table is temporary
* <tt>options</tt> user-defined SQL options for the table.
* <b>note:</b> you loose the default TYPE=InnoDB and utf-8 encoding statement if specified
* <b>note:</b> you loose the default ENGINE=InnoDB and utf-8 encoding statement if specified
* <tt>id</tt> if false will opt to create a primary key-less table
* (unless specifically defined for a column)
* <tt>comment</tt> comment for the table
Expand Down Expand Up @@ -280,7 +280,7 @@ function create_table($table="",$opt=array(),$fields=array()) {
$config['fields'][]=$val;
$glue[]="\n(\n".join(",\n",$config['fields'])."\n)";
$glue[]=!empty($opt['comment']) ? 'COMMENT="'.$opt['comment'].'"' : "";
$glue[]=!empty($opt['options']) ? $opt['options'] : "TYPE = InnoDB /*!40100 DEFAULT CHARSET utf8 COLLATE utf8_general_ci */";
$glue[]=!empty($opt['options']) ? $opt['options'] : "ENGINE = InnoDB /*!40100 DEFAULT CHARSET utf8 COLLATE utf8_general_ci */";
array_walk($glue,'trim');
$glue[]=";";
execute(trim(join(" ",$glue)));
Expand Down

0 comments on commit 796152f

Please sign in to comment.