From 3f6e294605c71197d65c37d43e6e50c07d7b0370 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Mon, 13 May 2013 22:36:19 -0400 Subject: [PATCH] Simplify tests for autoincrement in sqlite. --- lib/Cake/Database/Schema/SqliteSchema.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Database/Schema/SqliteSchema.php b/lib/Cake/Database/Schema/SqliteSchema.php index 51cf2592247..0a093de3f06 100644 --- a/lib/Cake/Database/Schema/SqliteSchema.php +++ b/lib/Cake/Database/Schema/SqliteSchema.php @@ -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) {