Skip to content
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

README clarification regarding model and table generation process #3

Closed
wjgilmore opened this issue May 26, 2010 · 1 comment
Closed

Comments

@wjgilmore
Copy link
Contributor

Took me a while to figure this one out, in order to generate the database tables you must first generate your application models:

  1. zf generate-models-from-yaml doctrine
  2. zf build-project doctrine --load

Much of the confusion stems from the latter command in particular not actually reporting any errors related to the inability to generate tables. Some source debugging indicates that Doctrine will silently "create" a list of tables which have been populated into an array as a result of loading the application models, however Doctrine will not report an error when that array happens to be empty, which is the case when the above command #1 is not executed first.

[Edit: Finally, to load your fixtures after executing the above two commands, execute zf load-data doctrine. Works like a charm. :-)]

Thanks!
Jason

@oliverturner
Copy link

In the case of a modular set-up, you may also need to create a module bootstrap containing something like the following:
class Default_Bootstrap extends Zend_Application_Module_Bootstrap
{
protected $_moduleName = 'default';

    protected function _initConfiguration()
    {
        $options = $this->getApplication()->getOptions();
        $libPath = '/modules/' . $this->_moduleName . '/library';

        set_include_path(implode(PATH_SEPARATOR, array(
            realpath(APPLICATION_PATH . $libPath),
            get_include_path(),
        )));

        return $options;
    }
}

And then add
autoloadernamespaces[] = "Default"
to your main application ini

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants