{"record":{"id":"1d924aa368d18740","repo":"yiisoft/yii2","slug":"the-version-argument-must-be-either-a-timestamp-e","errorCode":null,"errorMessage":"The version argument must be either a timestamp (e.g. 101129_185401),\n the full name of a migration (e.g. m101129_185401_create_user_table),\n the full namespaced name of a migration (e.g. app\\migrations\\M101129185401CreateUserTable),\n a UNIX timestamp (e.g. 1392853000), or a datetime string parseable\nby the strtotime() function (e.g. 2014-02-15 13:00:50).","messagePattern":"The version argument must be either a timestamp \\(e\\.g\\. 101129_185401\\),\n the full name of a migration \\(e\\.g\\. m101129_185401_create_user_table\\),\n the full namespaced name of a migration \\(e\\.g\\. app\\\\migrations\\\\M101129185401CreateUserTable\\),\n a UNIX timestamp \\(e\\.g\\. 1392853000\\), or a datetime string parseable\nby the strtotime\\(\\) function \\(e\\.g\\. 2014-02-15 13:00:50\\)\\.","errorType":"exception","errorClass":"yii\\console\\Exception","httpStatus":null,"severity":"error","filePath":"framework/console/controllers/BaseMigrateController.php","lineNumber":406,"sourceCode":"     *\n     * @param string $version either the version name or the certain time value in the past\n     * that the application should be migrated to. This can be either the timestamp,\n     * the full name of the migration, the UNIX timestamp, or the parseable datetime\n     * string.\n     * @throws Exception if the version argument is invalid.\n     */\n    public function actionTo($version)\n    {\n        if (($namespaceVersion = $this->extractNamespaceMigrationVersion($version)) !== false) {\n            return $this->migrateToVersion($namespaceVersion);\n        } elseif (($migrationName = $this->extractMigrationVersion($version)) !== false) {\n            return $this->migrateToVersion($migrationName);\n        } elseif ((string) (int) $version == $version) {\n            return $this->migrateToTime($version);\n        } elseif (($time = strtotime($version)) !== false) {\n            return $this->migrateToTime($time);\n        } else {\n            throw new Exception(\"The version argument must be either a timestamp (e.g. 101129_185401),\\n the full name of a migration (e.g. m101129_185401_create_user_table),\\n the full namespaced name of a migration (e.g. app\\\\migrations\\\\M101129185401CreateUserTable),\\n a UNIX timestamp (e.g. 1392853000), or a datetime string parseable\\nby the strtotime() function (e.g. 2014-02-15 13:00:50).\");\n        }\n    }\n\n    /**\n     * Modifies the migration history to the specified version.\n     *\n     * No actual migration will be performed.\n     *\n     * ```\n     * yii migrate/mark 101129_185401                        # using timestamp\n     * yii migrate/mark m101129_185401_create_user_table     # using full name\n     * yii migrate/mark app\\migrations\\M101129185401CreateUser # using full namespace name\n     * 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","sourceCodeStart":388,"sourceCodeEnd":424,"githubUrl":"https://github.com/yiisoft/yii2/blob/66f00d18a29b520f85e8e8f1e32d1e7e7b556cac/framework/console/controllers/BaseMigrateController.php#L388-L424","documentation":"Error \"The version argument must be either a timestamp (e.g. 101129_185401),\n the full name of a migration (e.g. m101129_185401_create_user_table),\n the full namespaced name of a migration (e.g. app\\migrations\\M101129185401CreateUserTable),\n a UNIX timestamp (e.g. 1392853000), or a datetime string parseable\nby the strtotime() function (e.g. 2014-02-15 13:00:50).\" thrown in yiisoft/yii2.","triggerScenarios":"Thrown at framework/console/controllers/BaseMigrateController.php:406 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"}