Browse Source

Schema refresh moved to `Migration::init()`.

tags/2.0.6
Klimov Paul 9 years ago
parent
commit
e683e3e79d
  1. 2
      framework/db/Migration.php

2
framework/db/Migration.php

@ -66,6 +66,7 @@ class Migration extends Component implements MigrationInterface
{ {
parent::init(); parent::init();
$this->db = Instance::ensure($this->db, Connection::className()); $this->db = Instance::ensure($this->db, Connection::className());
$this->db->getSchema()->refresh();
} }
/** /**
@ -162,7 +163,6 @@ class Migration extends Component implements MigrationInterface
$time = microtime(true); $time = microtime(true);
$this->db->createCommand($sql)->bindValues($params)->execute(); $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";
$this->db->getSchema()->refresh(); // ensure possible schema changes applied
} }
/** /**

Loading…
Cancel
Save