{"record":{"id":"ab29e32f8f9b0796","repo":"yiisoft/yii2","slug":"at-least-one-of-migrationpath-or-migrationnames","errorCode":null,"errorMessage":"At least one of `migrationPath` or `migrationNamespaces` should be specified.","messagePattern":"At least one of `migrationPath` or `migrationNamespaces` should be specified\\.","errorType":"console","errorClass":"yii\\base\\InvalidConfigException","httpStatus":null,"severity":"error","filePath":"framework/console/controllers/BaseMigrateController.php","lineNumber":141,"sourceCode":"            $actionID === 'create' ? ['templateFile'] : [] // action create\n        );\n    }\n\n    /**\n     * This method is invoked right before an action is to be executed (after all possible filters.)\n     * It checks the existence of the [[migrationPath]].\n     * @param Action<static> $action the action to be executed.\n     * @throws InvalidConfigException if directory specified in migrationPath doesn't exist and action isn't \"create\".\n     * @return bool whether the action should continue to be executed.\n     *\n     * @phpstan-param Action<static> $action\n     * @psalm-param Action<self> $action\n     */\n    public function beforeAction($action)\n    {\n        if (parent::beforeAction($action)) {\n            if (empty($this->migrationNamespaces) && empty($this->migrationPath)) {\n                throw new InvalidConfigException('At least one of `migrationPath` or `migrationNamespaces` should be specified.');\n            }\n\n            $this->migrationNamespaces = (array) $this->migrationNamespaces;\n\n            foreach ($this->migrationNamespaces as $key => $value) {\n                $this->migrationNamespaces[$key] = trim($value, '\\\\');\n            }\n\n            if (is_array($this->migrationPath)) {\n                foreach ($this->migrationPath as $i => $path) {\n                    $this->migrationPath[$i] = Yii::getAlias($path);\n                }\n            } elseif ($this->migrationPath !== null) {\n                $path = Yii::getAlias($this->migrationPath);\n                if (!is_dir($path)) {\n                    if ($action->id !== 'create') {\n                        throw new InvalidConfigException(\"Migration failed. Directory specified in migrationPath doesn't exist: {$this->migrationPath}\");\n                    }","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/yiisoft/yii2/blob/66f00d18a29b520f85e8e8f1e32d1e7e7b556cac/framework/console/controllers/BaseMigrateController.php#L123-L159","documentation":"Error \"At least one of `migrationPath` or `migrationNamespaces` should be specified.\" thrown in yiisoft/yii2.","triggerScenarios":"Thrown at framework/console/controllers/BaseMigrateController.php:141 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"}