propelorm / PropelBundle

PropelBundle for Symfony.
http://propelorm.org/Propel/documentation/#working-with-symfony2
180 stars 156 forks source link

propel:model:build can't find schema.xml #436

Closed kinekt4 closed 7 years ago

kinekt4 commented 8 years ago

After editing the schema file to add either the package or namespace attribute, the build command seems to have forgotten where the schema file is.

Schema

<database name="default" defaultIdMethod="native" defaultPhpNamingMethod="underscore">
....
</database>

How to Reproduce

php app/console propel:database:reverse default
cp ./generated-reversed-database/schema.xml ./src/CompanyName/AppBundle/Resource/config/.
php app/console propel:model:build --connection=conn1

ERROR

Please define a package attribute or a namespace attribute for schema schema.xml

UPDATE schema.xml

<database name="default" defaultIdMethod="native" defaultPhpNamingMethod="underscore"
package="src" namespace="CompanyName\AppBundle\Model">

RUN BUILD

php app/console propel:model:build --connection=conn1

ERROR

No schema files were found (matching your schema fileset definition)

Work around

cp src/CompanyName/AppBundle/Resource/config/schema.xml app/cache/dev/propel/.

This issue has also been documented here: http://techiekhanna.blogspot.com.au/2015/04/propel-2-and-symfony-26.html

Env php: v 5.6 symfony: v 2.8 propel: v2.0 propel bundle: v2.0

marcj commented 8 years ago

in your database is name="default" but you try to build models for --connection=conn1

kinekt4 commented 7 years ago

Thanks @marcj . I think that did the trick