Commit f9024dbe by Carsten Brandt

fixed Migration::execute() to use params correctly

parent da07230a
...@@ -1276,8 +1276,8 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface ...@@ -1276,8 +1276,8 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
/** /**
* @param array $link * @param array $link
* @param ActiveRecord $foreignModel * @param BaseActiveRecord $foreignModel
* @param ActiveRecord $primaryModel * @param BaseActiveRecord $primaryModel
* @throws InvalidCallException * @throws InvalidCallException
*/ */
private function bindModels($link, $foreignModel, $primaryModel) private function bindModels($link, $foreignModel, $primaryModel)
......
...@@ -139,7 +139,7 @@ class Migration extends \yii\base\Component ...@@ -139,7 +139,7 @@ class Migration extends \yii\base\Component
{ {
echo " > execute SQL: $sql ..."; echo " > execute SQL: $sql ...";
$time = microtime(true); $time = microtime(true);
$this->db->createCommand($sql)->execute($params); $this->db->createCommand($sql)->bindValues($params)->execute();
echo " done (time: " . sprintf('%.3f', microtime(true) - $time) . "s)\n"; echo " done (time: " . sprintf('%.3f', microtime(true) - $time) . "s)\n";
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment