Closed kinekt4 closed 7 years ago
If you remove that package attribute, it should be placed in the correct folder.
Hi marcj. Adding or removing the package attribute doesn't seem to make any difference
Are you using the latest propel bundle version? My XML file in my bundles look like
<?xml version="1.0"?>
<database name="default" namespace="Company\CoreBundle\Model">
<table name="job" allowPkInsert="true">
</table>
</database>
and is placed in src/Company/CoreBundle/Resources/config/schema/schema.xml
. Models will be generated in src/Company/CoreBundle/Model
. Works perfectly in all of our projects. I'm using Symfony 2.8 and in newer projects Symfony 3.0, each with PropelBundle of 3.0 branch.
My composer.json
"symfony/symfony": "2.8.*",
"propel/propel": "~2.0@dev",
"propel/propel-bundle": "~2.0@dev",
Should I be using PropelBundle 3.0 instead?
I was following these guidelines:
The 2.0 branch contains Propel2 integration for Symfony 2. The 3.0 branch contains Propel2 integration for Symfony 3.
Issue #436 is related to this issue.
To resolve both issues ensure your database schema follows the following rule:
Schema
<database name="conn1" namespace="CompanyName\AppBundle\Model">
Build
php app/console propel:model:build --connection=conn1
Also, the reverse engineering process adds some attributes to the schema that are no longer required for the build. Keep only the following:
@marcj I think the rule "The name attribute must match the connection you use in your build" is flawed
I may want to (which in this case I do), to reverse engineer from connection default but I want to build for connection conn1 instead.
Specifically - for me:
In a nutshell, I'm doing a work around to reverse-engineer some MS SQL DB tables.
Is it a worthwhile feature request to remove that particular requirement?
As an aside, when I change both places to use the MS SQL connection I get the following error:
[Propel\Generator\Exception\BehaviorNotFoundException]
Unknown behavior "typehintable". You may try running `composer update` or passing the `--composer-dir` option.
So that's not an option for me atm
I'm trying to build some models from a schema.xml file and the build process does not respect the package attribute. Although it does respect the namespace attribute.
Schema
How to Reproduce
The generated models were created here:
Expected Behaviour
Work around
Env php: v 5.6 symfony: v 2.8 propel: v2.0 propel bundle: v2.0