2012-07-27 41 views
0

當我嘗試建立模型,我得到這個錯誤:無效的架構元素「OperationC-> columns->關係

命名爲無效的架構元素‘用戶’在路徑」 OperationC- > columns->關係

這裏是我的schema.yml:

Contact: 
    connection: doctrine 
    tableName: contact 
    columns: 

    id_contact: 
     type: integer(2) 
     fixed: false 
     unsigned: false 
     primary: true 
     autoincrement: true 
    nom: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    fonction_organisme: 
     type: string(1000) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    categorie: 
     type: string(300) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    region: 
     type: string(1000) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    province: 
     type: string(500) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    adresse: 
     type: string(1000) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    tel1: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    tel2: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    tel3: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    tel4: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    email: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    fax: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    ville: 
     type: string(50) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    journal: 
     type: string(2000) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    commentaire: 
     type: string(2000) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    fix: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    image: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    owner: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    relations: 
    Evenement: 
     local: id_contact 
     foreign: id_contact_event 
     type: many 
    Users : 
     class : User 
     refclass : Operation_contact 
     foreignAlias : Contact 
Courrier: 
    connection: doctrine 
    tableName: courrier 
    columns: 
    num_serie: 
     type: integer(2) 
     fixed: false 
     unsigned: false 
     primary: true 
     autoincrement: false 
    annee: 
     type: integer(2) 
     fixed: false 
     unsigned: false 
     primary: true 
     autoincrement: false 
    num_c: 
     type: integer(2) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    exp: 
     type: string(500) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    dest: 
     type: string(500) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    state: 
     type: string(10) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    objet: 
     type: string(1000) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    image_c: 
     type: string(500) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    date_recep: 
     type: date(25) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    date_env: 
     type: date(25) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    owner_c: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    user_c: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    type_c: 
     type: string(500) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    relations : 
    Users : 
     class : User 
     refclass : Operation_c 
     foreignAlias : Courriers 
Evenement: 
    connection: doctrine 
    tableName: evenement 
    columns: 
    id_event: 
     type: integer(2) 
     fixed: false 
     unsigned: false 
     primary: true 
     autoincrement: true 
    date: 
     type: date(25) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    action: 
     type: string(2000) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    id_contact_event: 
     type: integer(2) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    relations: 
    Contact: 
     local: id_contact_event 
     foreign: id_contact 
     type: one 
OperationC: 
    connection: doctrine 
    tableName: operation_c 
    columns: 
    id_user: 
     type: integer(2) 
     fixed: false 
     unsigned: false 
     primary: true 
     autoincrement: false 
    num_serie: 
     type: integer(2) 
     fixed: false 
     unsigned: false 
     primary: true 
     autoincrement: false 
    operation_c: 
     type: string(2000) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    date_op_c: 
     type: date(25) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    relations : 
     User : { onDelete : CASCADE } 
     Courrier : { onDelete : CASCADE } 
OperationContact: 
    connection: doctrine 
    tableName: operation_contact 
    columns: 
    id_contact: 
     type: integer(2) 
     fixed: false 
     unsigned: false 
     primary: true 
     autoincrement: false 
    id_user: 
     type: integer(2) 
     fixed: false 
     unsigned: false 
     primary: true 
     autoincrement: false 
    operation: 
     type: string(2000) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    date_op: 
     type: date(25) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    relations : 
     User : { onDelete : CASCADE } 
     Courrier : { onDelete : CASCADE } 
User: 
    connection: doctrine 
    tableName: user 
    columns: 
    id_user: 
     type: integer(2) 
     fixed: false 
     unsigned: false 
     primary: true 
     autoincrement: true 
    nom_user: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    adresse_user: 
     type: string(2000) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    tel_user: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    login: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    password: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 

回答

1

你有很多錯誤在你的schema.yml

  • reclass應該是refClass
  • 你把一些不好的縮進一些relations(這是你所描述的錯誤)
  • 有在命名錶/關係(爲Operation_contactOperation_c

這裏是一些錯誤是你的工作和固定schema.yml

Contact: 
    connection: doctrine 
    tableName: contact 
    columns: 

    id_contact: 
     type: integer(2) 
     fixed: false 
     unsigned: false 
     primary: true 
     autoincrement: true 
    nom: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    fonction_organisme: 
     type: string(1000) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    categorie: 
     type: string(300) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    region: 
     type: string(1000) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    province: 
     type: string(500) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    adresse: 
     type: string(1000) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    tel1: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    tel2: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    tel3: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    tel4: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    email: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    fax: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    ville: 
     type: string(50) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    journal: 
     type: string(2000) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    commentaire: 
     type: string(2000) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    fix: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    image: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    owner: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    relations: 
    Evenement: 
     local: id_contact 
     foreign: id_contact_event 
     type: many 
    Users : 
     class : User 
     refClass : OperationContact 
     foreignAlias : Contact 
Courrier: 
    connection: doctrine 
    tableName: courrier 
    columns: 
    num_serie: 
     type: integer(2) 
     fixed: false 
     unsigned: false 
     primary: true 
     autoincrement: false 
    annee: 
     type: integer(2) 
     fixed: false 
     unsigned: false 
     primary: true 
     autoincrement: false 
    num_c: 
     type: integer(2) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    exp: 
     type: string(500) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    dest: 
     type: string(500) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    state: 
     type: string(10) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    objet: 
     type: string(1000) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    image_c: 
     type: string(500) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    date_recep: 
     type: date(25) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    date_env: 
     type: date(25) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: false 
     autoincrement: false 
    owner_c: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    user_c: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    type_c: 
     type: string(500) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    relations : 
    Users : 
     class : User 
     refClass : OperationC 
     foreignAlias : Courriers 
Evenement: 
    connection: doctrine 
    tableName: evenement 
    columns: 
    id_event: 
     type: integer(2) 
     fixed: false 
     unsigned: false 
     primary: true 
     autoincrement: true 
    date: 
     type: date(25) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    action: 
     type: string(2000) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    id_contact_event: 
     type: integer(2) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    relations: 
    Contact: 
     local: id_contact_event 
     foreign: id_contact 
     type: one 
OperationC: 
    connection: doctrine 
    tableName: OperationC 
    columns: 
    id_user: 
     type: integer(2) 
     fixed: false 
     unsigned: false 
     primary: true 
     autoincrement: false 
    num_serie: 
     type: integer(2) 
     fixed: false 
     unsigned: false 
     primary: true 
     autoincrement: false 
    OperationC: 
     type: string(2000) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    date_op_c: 
     type: date(25) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    relations : 
    User : { onDelete : CASCADE } 
    Courrier : { onDelete : CASCADE } 
OperationContact: 
    connection: doctrine 
    tableName: OperationContact 
    columns: 
    id_contact: 
     type: integer(2) 
     fixed: false 
     unsigned: false 
     primary: true 
     autoincrement: false 
    id_user: 
     type: integer(2) 
     fixed: false 
     unsigned: false 
     primary: true 
     autoincrement: false 
    operation: 
     type: string(2000) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    date_op: 
     type: date(25) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    relations : 
    User : { onDelete : CASCADE } 
    Courrier : { onDelete : CASCADE } 
User: 
    connection: doctrine 
    tableName: user 
    columns: 
    id_user: 
     type: integer(2) 
     fixed: false 
     unsigned: false 
     primary: true 
     autoincrement: true 
    nom_user: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    adresse_user: 
     type: string(2000) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    tel_user: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    login: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false 
    password: 
     type: string(30) 
     fixed: false 
     unsigned: false 
     primary: false 
     notnull: true 
     autoincrement: false