/** * Construct migration schema. * @param MigratableDatabase The database to migrate. */ public function __construct(MigratableDatabase $db) { $this->db = $db; $this->targetSchema = $db->getSchema(); $db->refreshSchema(); $current = $db->getSchema(); foreach ($current->getTables() as $table) { $this->tables[] = $table; $this->schemas[$table] = $current->getSchema($table); } $db->setSchema($this); }