I have 53 tables and a lot of them reference eachother with relationships. When i run:
php app/console doctrine:schema:create
I get the error maximum nesting level of 100 reached. Through research i found this is actually a security measure from xdebug to stop infinite loops. When i remove this limitation and run the command again the php cli stops working and im forced to close it.
Is there anyway to generate the schema in steps like build the database structure then go back and add the mappings and the indexes so that it doesnt fail?
Or is it possible that I am doing something else wrong?
MySQL does work and i can create schemas that have less tables / relationships using this same method.
UPDATE: doctrine:schema:create --dump-sql hangs as well. Both max nesting level and max execution time are set to unlimited. Still PHP CLI stops working:
Problem signature:
Problem Event Name: APPCRASH
Application Name: php.exe
Application Version: 5.3.26.0
Application Timestamp: 51af706d
Fault Module Name: ntdll.dll
Fault Module Version: 6.1.7601.17725
Fault Module Timestamp: 4ec49b8f
Exception Code: c00000fd
Exception Offset: 0002e8fb
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 1033
Additional Information 1: 8983
Additional Information 2: 898375922a25a99ebc5721487ed92891
Additional Information 3: f337
Additional Information 4: f3378ae3d6023e7f336317eca89ba0b7
You have to increase the value of xdebug.max_nesting_level
( which defaults to 100 ) in your php.ini to circumvent the maximum nesting level of 100 reached
error.
You'll most likely run into this issue multiple times for example during cache warmup - not only when trying to create the database schema. Therefore increase the value for all your symfony development - same goes for magento and zf ...
Check the max_execution_time
setting aswell and maybe inspect using a profiler (xdebug/xhprof) if the command seems to hang. It might take some time to create the schema, bring some patience :)
There are no options for the doctrine:schema:create
command to "split" the operation.
Try if doctrine:schema:create --dump-sql
hangs aswell.
A really dirty workaround:
You could define new kernel environments (i.e. step1, step2), create different mappings (getting more and more detailed) or manually configure only a few of them in the first "steps"/environments, register/override them in config_stepx.yml and use something like
doctrine:schema:create --env=step1
doctrine:schema:update --env=step2
...
... but that would really be a mess.
from my experience the command should work even for large datasets. i have created schemas for applications with >100 tables without any problems.
The answer is my entities had a self referencing one to one relationship on the same key that was being used as the primary key. Thus creating an infinite loop during creation.
Not really sure why it was there in the first place some of these were generated by the doctrine database reverse engineering command.