/** * Construct migration definition. * * @param MigratableDatabase $db The database to migrate. */ public function __construct(MigratableDatabase $db) { $this->db = $db; $this->targetDefinition = $db->getDefinition(); $db->refreshDefinition(); $current = $db->getDefinition(); foreach ($current->getTables() as $table) { $this->tables[] = $table; $this->definitions[$table] = $current->getDefinition($table); } $db->setDefinition($this); }