/** * @inheritdoc */ protected function getNewMigrations() { $result = []; foreach ($this->allMigrationPaths as $path) { $this->migrationPath = $path; if (!file_exists($path)) { continue; } $result = array_merge($result, parent::getNewMigrations()); } $this->migrationPath = $this->allMigrationPaths['app']; sort($result); return $result; }
/** * Returns the migrations that are not applied. * @return array list of new migrations */ protected function getNewMigrations() { $applied = []; foreach ($this->getMigrationHistory(-1) as $version => $time) { $applied[substr($version, 1, 13)] = true; } $migrations = parent::getNewMigrations(); $handle = opendir($this->migrationPlatformPath); while (($file = readdir($handle)) !== false) { if ($file === '.' || $file === '..') { continue; } $path = $this->migrationPlatformPath . DIRECTORY_SEPARATOR . $file; if (preg_match('/^(m(\\d{6}_\\d{6})_.*?)\\.php$/', $file, $matches) && is_file($path) && !isset($applied[$matches[2]])) { $migrations[] = $matches[1]; } } closedir($handle); sort($migrations); return $migrations; }
/** * Returns the migrations that are not applied. * @return array list of new migrations */ protected function getNewMigrations() { if (!$this->includeModuleMigrations) { return parent::getNewMigrations(); } $this->migrationPathMap = []; $migrations = []; foreach ($this->getMigrationPaths() as $migrationPath) { $this->migrationPath = $migrationPath; $migrations = array_merge($migrations, parent::getNewMigrations()); $this->migrationPathMap[$migrationPath] = $migrations; } sort($migrations); return $migrations; }
/** * Filter migrations only with namespace * @return array */ protected function getNewMigrations() { $migrations = parent::getNewMigrations(); $migrations = array_filter($migrations, [$this, 'nameHasNamespace']); return $migrations; }
public function getNewMigrations() { return parent::getNewMigrations(); }