Ticket #1223 (closed defect: fixed)

Opened 12 months ago

Last modified 10 months ago

Checks are not working in YAML

Reported by: JeroenFM Owned by: jwage
Priority: minor Milestone:
Component: Schema Files Version: 1.0.0
Severity: Keywords: check,schema,yaml
Cc: Has Test: no
Status: Pending Core Response Has Patch: no

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

Changed 11 months ago by jwage

  • version changed from 0.11 to 1.0
  • milestone changed from Unknown to 1.0.0-RC1

Changed 11 months ago by jwage

  • status changed from new to closed
  • resolution set to fixed

(In [4753]) fixes #1223

Changed 10 months ago by anonymous

  • milestone New deleted

Milestone New deleted

Note: See TracTickets for help on using tickets.