public function registerPreviousMigratedVersions()
    {
        $app = Application::getFacadeApplication();
        $db = $app->make(Connection::class);
        try {
            $minimum = $db->fetchColumn('select min(version) from SystemDatabaseMigrations');
        } catch (Exception $e) {
            return;
        }
        $migrations = $this->getMigrations();
        $keys = array_keys($migrations);

        if ($keys[0] == $minimum) {
            // This is the first migration in concrete5. That means we have already populated this table.
            return;
        } else {
            // We have to populate this table with all the migrations from the very first migration up to
            // the $minMigration
            foreach ($migrations as $key => $migration) {
                if ($key < $minimum) {
                    $migration->markMigrated();
                }
            }
        }
    }