{"record":{"id":"e58dd8f4a2acac31","repo":"yiisoft/yii2","slug":"unable-to-find-the-version-originalversion","errorCode":null,"errorMessage":"Unable to find the version '$originalVersion'.","messagePattern":"Unable to find the version '\\$originalVersion'\\.","errorType":"exception","errorClass":"yii\\console\\Exception","httpStatus":null,"severity":"error","filePath":"framework/console/controllers/BaseMigrateController.php","lineNumber":473,"sourceCode":"        // try mark down\n        $migrations = array_keys($this->getMigrationHistory(null));\n        $migrations[] = static::BASE_MIGRATION;\n        foreach ($migrations as $i => $migration) {\n            if (strpos($migration, $version) === 0) {\n                if ($i === 0) {\n                    $this->stdout(\"Already at '$originalVersion'. Nothing needs to be done.\\n\", Console::FG_YELLOW);\n                } elseif ($this->confirm(\"Set migration history at $originalVersion?\")) {\n                    for ($j = 0; $j < $i; ++$j) {\n                        $this->removeMigrationHistory($migrations[$j]);\n                    }\n                    $this->stdout(\"The migration history is set at $originalVersion.\\nNo actual migration was performed.\\n\", Console::FG_GREEN);\n                }\n\n                return ExitCode::OK;\n            }\n        }\n\n        throw new Exception(\"Unable to find the version '$originalVersion'.\");\n    }\n\n    /**\n     * Drops all tables and related constraints. Starts the migration from the beginning.\n     *\n     * ```\n     * yii migrate/fresh\n     * ```\n     *\n     * @since 2.0.13\n     */\n    public function actionFresh()\n    {\n        if (YII_ENV_PROD) {\n            $this->stdout(\"YII_ENV is set to 'prod'.\\nRefreshing migrations is not possible on production systems.\\n\");\n\n            return ExitCode::OK;\n        }","sourceCodeStart":455,"sourceCodeEnd":491,"githubUrl":"https://github.com/yiisoft/yii2/blob/66f00d18a29b520f85e8e8f1e32d1e7e7b556cac/framework/console/controllers/BaseMigrateController.php#L455-L491","documentation":"Error \"Unable to find the version '$originalVersion'.\" thrown in yiisoft/yii2.","triggerScenarios":"Thrown at framework/console/controllers/BaseMigrateController.php:473 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"66f00d18a29b520f85e8e8f1e32d1e7e7b556cac","analyzedAt":"2026-08-17T05:17:23.470Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}