Ticket #1223 (closed defect: fixed)
Checks are not working in YAML
Description
I am using release 0.11 and am unable to add a Check constraint to my database using YAML
MyTable:
columns:
assigner_id:
type: integer
notnull: true
assignee_id:
type: integer
notnull: true
relations:
# Some stuff relating this table to others
checks:
check_1: assigner_id <> assignee_id
# Not sure if <> is correct syntax but I can use != or a combination of a < and > constraint if it doesn't work
Fatal error: Uncaught exception 'Doctrine_Import_Exception' with message 'Invalid schema element named "checks"
at path "Tribunal"' in MY_PATH/doctrine/lib/Doctrine/Import/Schema.php:697
Stack trace:
#0 MY_PATH/doctrine/lib/Doctrine/Import/Schema.php(328): Doctrine_Import_Schema->_validateSchemaElement('root', Array, 'Tribunal')
#1 MY_PATH/doctrine/lib/Doctrine/Import/Schema.php(217): Doctrine_Import_Schema->parseSchema('tysan.yml', 'yml')
#2 MY_PATH/doctrine/lib/Doctrine/Import/Schema.php(257): Doctrine_Import_Schema->buildSchema('tysan.yml', 'yml')
#3 MY_PATH/doctrine/lib/Doctrine.php(774): Doctrine_Import_Schema->importSchema('my_schema.yml', 'yml', 'model')
#4 MY_PATH/gen.php(10): Doctrine::generateModelsFromYaml('my_schema.yml', 'model')
#5 {main}
thrown in /home/jeroen/httpdocs/tysan/doctrine/lib/Doctrine/Import/Schema.php on line 697
Variable $_validation in http://trac.phpdoctrine.org/browser/branches/0.11/lib/Doctrine/Import/Schema.php?rev=4502 does not contain a 'checks' index, nor does adding one solve the problem (error disappears but checks are not created).
Also posted in the forums at: http://www.phpdoctrine.org/forum/viewtopic.php?f=2&t=17&start=0&st=0&sk=t&sd=a
Change History
Note: See
TracTickets for help on using
tickets.