0
votes

I use symfony in version 1.4.9 with doctrine.

symfony doctrine:build-schema works and create a schema in config/doctrine/schema.yml

symfony doctrine:build-model fails with the following message:

>> doctrine  generating model classes
>> file+     /tmp/doctrine_schema_92251.yml
Invalid schema element named "class" at path "doctrine"

the tmp/doctrine_schema_922... is this:

doctrine:
  class: sfDoctrineDatabase
  param:
    dsn: 'mysql:host=localhost;dbname=xxxxx'
    username: xxxxx
    password: xxxxx
    attributes:
      use_dql_callbacks: true
      use_native_enum: true
Products:
  connection: doctrine
  tableName: products
  columns:
    product_id:
      type: integer
...

any ideas whats wrong?

1
Can you post your schema.yml? - Pabloks
Did you intent with spaces and not tabs? - DrColossos

1 Answers

2
votes

I don't think the first section of your schema is valid, I have never seen this before.

doctrine:
  class: sfDoctrineDatabase
  param:
    dsn: 'mysql:host=localhost;dbname=xxxxx'
    username: xxxxx
    password: xxxxx
    attributes:
      use_dql_callbacks: true
      use_native_enum: true

The database connection string should go in your database.yml file. In fact, this whole section resembles something that would go in the database.yml file. The remaining code in your schema looks good.