1
votes

I have written my yaml schema for the database for my Symfony+doctrine application, and I'm trying to get it to make the models and such, but it errors on doctrine:build-model

$> ./symfony doctrine:build-model
>> doctrine generating model classes

>> file+ /tmp/doctrine_schema_89653.yml

   No yml schema found in /tmp/doctrine_schema_89653.yml

I put my schema in config/doctrine/schema.yml, where it should be according to all the tutorials I have gone through. After some googling I think there might be a syntax error in my yaml, but I am not sure. Here it is just in case:

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

I'm not sure what else there would be, does anyone know what other kinds of things might cause that error? It doesn't really make sense...

EDIT: I just looked in /tmp for the file, and it is there. it contins { } and thats it.

2

2 Answers

2
votes

Yeah, had the same error recently, a nuisance. What it's doing is that it's trying to load an old temp file instead of the one you want it to use:

"No yml schema found in /tmp/doctrine_schema_89653.yml"

Find this temp file folder (I'm running XAMPP on Windows so mine was in the XAMPP folders), erase all old schema files from there, and build again. You may need to do this repeatedly, as a temp file is created every time.

0
votes

I see your schema.yml has set 4 spaces as indentation. Mine always has 2 spaces. You could try that.

I also deleted all generated classes from the lib folder (eg. /lib/models/doctrine/* and forms (not the BaseForm.class.php) and filters, because symfony first generates the models and from there the sql and then inserts the sql in the db.