diff --git a/lib/Cake/Database/Schema/MysqlSchema.php b/lib/Cake/Database/Schema/MysqlSchema.php index f2f3a278439..3b5489e4594 100644 --- a/lib/Cake/Database/Schema/MysqlSchema.php +++ b/lib/Cake/Database/Schema/MysqlSchema.php @@ -142,8 +142,8 @@ public function convertFieldDescription(Table $table, $row, $fieldParams = []) { } $table->addColumn($row['Field'], $field); if (!empty($row['Key']) && $row['Key'] === 'PRI') { - $table->addIndex('primary', [ - 'type' => Table::INDEX_PRIMARY, + $table->addConstraint('primary', [ + 'type' => Table::CONSTRAINT_PRIMARY, 'columns' => [$row['Field']] ]); }