-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"zf generate-sql doctrine" successfully generates sql file, but this file is empty #6
Comments
try 'zf show doctrine'. How many models it'll show? |
'zf show doctrine' returns: [Doctrine] Current Doctrine Model Directories: [Doctrine] All current models: [Doctrine] The current migration version is: 0 In spite of the fact I have successfully generated model files in 'D:\work\zd\application\models' |
I guess, you forgot to initialize module auotoloaders in bootstrap like this: class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { public function _initModuleLoaders() { $this->bootstrap('Frontcontroller'); $fc = $this->getResource('Frontcontroller'); $modules = $fc->getControllerDirectory(); foreach ($modules AS $module => $dir) { $moduleName = strtolower($module); $moduleName = str_replace(array('-', '.'), ' ', $moduleName); $moduleName = ucwords($moduleName); $moduleName = str_replace(' ', '', $moduleName); $loader = new Zend_Application_Module_Autoloader(array( 'namespace' => $moduleName, 'basePath' => realpath($dir . "/../"), )); } } } |
I haven't used modules - I've just changed all "Forum_" prefixes to "Default_" in model entities' names in my .yml schema file - so I think I don't need module autoloaders - my model files have been generated in default application model's directory. Moreover I'am sure it successfully locates model files as I can see it with FileMon utility. By the way - is there a way to debug cli php - because it reports no error-warnings neither to apache's error log nor stdout? Where are cli php settings located? |
i have the same problem |
I also have the same problem. And I'm using a modular setup. But I also get an error when trying to build my project: [Doctrine] No sql queries found to create tables from. My module/model directory contain generated model classes from th YAML schema. |
I also had the same problem. I'm not using Benjamin's generic module loader, so the needed classes were generated, but not loaded automatically by autoloader. The solution is, that I forgot to create Boostrap.php for this specific module. |
I have the same problem, when trying build project, generate sql or create tables. |
Hi Using the model_loading_zend it works fine. Thanks. |
I've had a similar issue to @HongKilDong & followers. In order to fix it I've had to delete a folder that accidentally appeared in the models/ directory. Apparently this tool doesn't accept anything other than models and Base/ directory in the models folder. |
I used forum.yml from readme for testing - model was generated successfully, but when I issued "zf generate-sql doctrine" it returns:
[Doctrine] Successfully written SQL for the current schema to disc.
[Doctrine] Destination File: D:\work\zd/application/configs/sql\schema_20100618_142043.sql
but generated file named "schema_20100618_142043.sql" was empty
The text was updated successfully, but these errors were encountered: