{"record":{"id":"d88a3246f18d30ee","repo":"yiisoft/yii2","slug":"the-version-argument-must-be-either-a-timestamp-e-d88a32","errorCode":null,"errorMessage":"The version argument must be either a timestamp (e.g. 101129_185401)\nor the full name of a migration (e.g. m101129_185401_create_user_table)\nor the full name of a namespaced migration (e.g. app\\migrations\\M101129185401CreateUserTable).","messagePattern":"The version argument must be either a timestamp \\(e\\.g\\. 101129_185401\\)\nor the full name of a migration \\(e\\.g\\. m101129_185401_create_user_table\\)\nor the full name of a namespaced migration \\(e\\.g\\. app\\\\migrations\\\\M101129185401CreateUserTable\\)\\.","errorType":"exception","errorClass":"yii\\console\\Exception","httpStatus":null,"severity":"error","filePath":"framework/console/controllers/BaseMigrateController.php","lineNumber":437,"sourceCode":"     * yii migrate/mark m000000_000000_base # reset the complete migration history\n     * ```\n     *\n     * @param string $version the version at which the migration history should be marked.\n     * This can be either the timestamp or the full name of the migration.\n     * You may specify the name `m000000_000000_base` to set the migration history to a\n     * state where no migration has been applied.\n     * @return int CLI exit code\n     * @throws Exception if the version argument is invalid or the version cannot be found.\n     */\n    public function actionMark($version)\n    {\n        $originalVersion = $version;\n        if (($namespaceVersion = $this->extractNamespaceMigrationVersion($version)) !== false) {\n            $version = $namespaceVersion;\n        } elseif (($migrationName = $this->extractMigrationVersion($version)) !== false) {\n            $version = $migrationName;\n        } elseif ($version !== static::BASE_MIGRATION) {\n            throw new Exception(\"The version argument must be either a timestamp (e.g. 101129_185401)\\nor the full name of a migration (e.g. m101129_185401_create_user_table)\\nor the full name of a namespaced migration (e.g. app\\\\migrations\\\\M101129185401CreateUserTable).\");\n        }\n\n        // try mark up\n        $migrations = $this->getNewMigrations();\n        foreach ($migrations as $i => $migration) {\n            if (strpos($migration, $version) === 0) {\n                if ($this->confirm(\"Set migration history at $originalVersion?\")) {\n                    for ($j = 0; $j <= $i; ++$j) {\n                        $this->addMigrationHistory($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        // try mark down","sourceCodeStart":419,"sourceCodeEnd":455,"githubUrl":"https://github.com/yiisoft/yii2/blob/66f00d18a29b520f85e8e8f1e32d1e7e7b556cac/framework/console/controllers/BaseMigrateController.php#L419-L455","documentation":"Error \"The version argument must be either a timestamp (e.g. 101129_185401)\nor the full name of a migration (e.g. m101129_185401_create_user_table)\nor the full name of a namespaced migration (e.g. app\\migrations\\M101129185401CreateUserTable).\" thrown in yiisoft/yii2.","triggerScenarios":"Thrown at framework/console/controllers/BaseMigrateController.php:437 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"}