diff --git a/src/think/console/command/optimize/Schema.php b/src/think/console/command/optimize/Schema.php index 6ce3e64a85..424daaf309 100644 --- a/src/think/console/command/optimize/Schema.php +++ b/src/think/console/command/optimize/Schema.php @@ -67,7 +67,12 @@ protected function execute(Input $input, Output $output) if (0 === strpos($file, '.')) { continue; } + $class = '\\' . $namespace . '\\model\\' . pathinfo($file, PATHINFO_FILENAME); + if (!class_exists($class)) { + continue; + } + $this->buildModelSchema($class); } }