public function setup()
{
$this->migrationsPath = $this->getPath();
$this->migrationsFiles = glob($this->migrationsPath . '*.php');
$this->phinxTable = $this->getPhinxTable($this->plugin);
$connection = ConnectionManager::get($this->connection);
$this->tables = $connection->schemaCollection()->listTables();
$tableExists = in_array($this->phinxTable, $this->tables);
$migratedItems = [];
if ($tableExists) {
$query = $connection->newQuery();
$migratedItems = $query->select(['version'])->from($this->phinxTable)->order(['version DESC'])->execute()->fetchAll('assoc');
}
$this->migratedItems = $migratedItems;
}