Skip to content

Commit

Permalink
Simplify tests for autoincrement in sqlite.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed May 14, 2013
1 parent ec426af commit 3f6e294
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/Database/Schema/SqliteSchema.php
Expand Up @@ -183,7 +183,7 @@ public function columnSql(Table $table, $name) {
if (isset($data['null']) && $data['null'] === false) {
$out .= ' NOT NULL';
}
if (in_array($data['type'], ['integer']) && in_array($name, (array)$table->primaryKey())) {
if ($data['type'] === 'integer' && $name == $table->primaryKey()[0]) {
$out .= ' PRIMARY KEY AUTOINCREMENT';
}
if (isset($data['null']) && $data['null'] === true) {
Expand Down

0 comments on commit 3f6e294

Please sign in to comment.