Database Symfony原则:构建模型错误

Database Symfony原则:构建模型错误,database,symfony1,doctrine,yaml,Database,Symfony1,Doctrine,Yaml,我已经为我的Symfony+条令应用程序的数据库编写了yaml模式,我正试图让它制作模型等等,但它在条令:构建模型 $>。/symfony原则:构建模型 >>条令生成模型类 >>文件+/tmp/doctrine_schema_89653.yml No yml schema found in /tmp/doctrine_schema_89653.yml 我把我的模式放在config/doctrine/schema.yml中,根据我读过的所有教程,它应该在那里。在谷歌搜索之后,我想我的yam

我已经为我的Symfony+条令应用程序的数据库编写了yaml模式,我正试图让它制作模型等等,但它在
条令:构建模型

$>。/symfony原则:构建模型
>>条令生成模型类

>>文件+/tmp/doctrine_schema_89653.yml

   No yml schema found in /tmp/doctrine_schema_89653.yml
我把我的模式放在
config/doctrine/schema.yml
中,根据我读过的所有教程,它应该在那里。在谷歌搜索之后,我想我的yaml可能有语法错误,但我不确定。这里只是以防万一:

Coder:
    actAs: [Timestampable]
    tableName: dormcode_coder
    columns:
        id:
            type: integer
            primary: true
            autoincrement: true
        username: string(60)
        password: string(60)
        email: string(255)
        firstname: string(60)
        lastname: string(60)
        
Client:
    actAs: [Timestampable]
    tableName: dormcode_client
    columns:
        id:
            type: integer
            primary: true
            autoincrement: true
        username: string(60)
        password: string(60)
        email: string(255)
        firstname: string(60)
        lastname: string(60)

Project:
    actAs: [Timestampable]
    tableName: dormcode_project
    columns:
        id:
            type: integer
            primary: true
            autoincrement: true
        client_id: integer
        title: string(255)
        briefdesc: clob
        spec: clob
        coder_id: 
            type: integer
            notnull: false
            default: null
        paytype: string(30)
        negotiable: 
            type: bool
            default: false
        complete: 
            type: bool
            default: false
    relations:
        Coder:
            foreignType: one
        Client:
            foreignType: one

Iteration:
    actAs: [Timestampable]
    tableName: dormcode_iteration
    columns:
        id:
            type: integer
            primary: true
            autoincrement: true
        ordernum: integer
        description: clob
        project_id: integer
    relations:
        Project:
            foreignAlias: Iterations
我不知道还有什么其他的原因,有人知道还有什么其他的原因会导致这个错误吗?这真的没有道理


编辑:我刚刚在/tmp中查找该文件,它就在那里。它包含
{}
,就是这样。

是的,最近也有同样的错误,令人讨厌。它正在尝试加载一个旧的临时文件,而不是您希望它使用的临时文件:

“在/tmp/doctrine_schema_89653.yml中未找到yml架构”


找到这个临时文件文件夹(我在Windows上运行XAMPP,所以我的文件在XAMPP文件夹中),从那里删除所有旧的模式文件,然后重新构建。您可能需要重复执行此操作,因为每次都会创建临时文件。

我看到您的模式。yml已将4个空格设置为缩进。我的总是有两个空格。你可以试试


我还从lib文件夹中删除了所有生成的类(例如/lib/models/doctor/*和表单(不是BaseForm.class.php)和过滤器,因为symfony首先生成模型,然后从那里生成sql,然后将sql插入数据库。

Hrm。我尝试了几次,但都没有用。这几乎就像没有意识到我在那里有一个架构,因为文件只有
{}
。很好,我只使用了最新版本的symfony 1.4/doctrine。早期版本没有这个问题。