private function loadMigrations()
    {
        // Load the migrations already performed

        $migrated = [];
        $rows = $this->db->table('_migrations')->select('name')->all();
        foreach ($rows as $row) {
            $migrated[] = $row['name'];
        }

        // Load the outstanding migrations

        $migrations = [];

        // read migrations from folder
        $files = [];
        list_files($files, $this->migrationPath, ['php']);
        foreach ($files as $file) {
            $name = basename($file, '.php');
            $migrations[$name] = $file;
        }

        // read migrations included by plugins
        $migrations = array_merge($migrations, $this->pluginMigrations());

        // remove migrations already performed
        foreach ($migrations as $name => $file) {
            if (in_array($name, $migrated)) {
                unset($migrations[$name]);
            }
        }

        return $migrations;
    }