From ee2a6b7e76097f530016f48c1737e6091e83c64a Mon Sep 17 00:00:00 2001 From: Sergey Gonimar Date: Sun, 16 Feb 2014 14:05:07 +0500 Subject: [PATCH] Update Migration.php --- framework/db/Migration.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/framework/db/Migration.php b/framework/db/Migration.php index c86711efee..0b51250d52 100644 --- a/framework/db/Migration.php +++ b/framework/db/Migration.php @@ -388,15 +388,15 @@ class Migration extends \yii\base\Component * Builds and executes a SQL statement for creating a new index. * @param string $name the name of the index. The name will be properly quoted by the method. * @param string $table the table that the new index will be created for. The table name will be properly quoted by the method. - * @param string $column the column(s) that should be included in the index. If there are multiple columns, please separate them + * @param string|array $columns the column(s) that should be included in the index. If there are multiple columns, please separate them * by commas or use an array. The column names will be properly quoted by the method. * @param boolean $unique whether to add UNIQUE constraint on the created index. */ - public function createIndex($name, $table, $column, $unique = false) + public function createIndex($name, $table, $columns, $unique = false) { - echo " > create" . ($unique ? ' unique' : '') . " index $name on $table (" . implode(',', (array)$column) . ") ..."; + echo " > create" . ($unique ? ' unique' : '') . " index $name on $table (" . implode(',', (array)$columns) . ") ..."; $time = microtime(true); - $this->db->createCommand()->createIndex($name, $table, $column, $unique)->execute(); + $this->db->createCommand()->createIndex($name, $table, $columns, $unique)->execute(); echo " done (time: " . sprintf('%.3f', microtime(true) - $time) . "s)\n"; }