Hello tout le monde,

je suis un n00b sur doctrine et Symfony, et j'essaie le framework sur un nouveau projet. J'ai réussi à créer mes tables et mes modèles, pas de problème là-dessus.

J'ai ensuite modifié le nom du champ type_id par type_oeuvres_id dans les relations de la table Oeuvre

et en relançant build-model, build-sql et insert-sql j'ai le message d'erreur suivant :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
 
SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'type_oeuvre_id' doesn't exist in table. Failing Query: "ALTER TABLE oeuvre ADD CONSTRAINT oeuvre_type_oeuvre_id_type_oeuvre_id FOREIGN KEY (type_oeuvre_id) REFERENCES type_oeuvre(id)". Failing Query: ALTER TABLE oeuvre ADD CONSTRAINT oeuvre_type_oeuvre_id_type_oeuvre_id FOREIGN KEY (type_oeuvre_id) REFERENCES type_oeuvre(id)
je ne comprends pas pourquoi...

Voici le fichier YAML

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 
Artiste:
  actAs: { Timestampable: ~ }
  columns:
    nom: { type: string(255) }
    prenom: { type: string(255) }
    tel: { type: string(255) }
    mail: { type: string(255) }
    rue: { type: string(255) }
    cp: { type: string(255) }
    ville: { type: string(255) }
    modifie_par: { type: integer }
 
Oeuvre:
  actAs: { Timestampable: ~ }
  columns:
     artiste_id: { type: integer, notnull: true }
     type_oeuvre_id: { type: integer, notnull: true }
     nom: { type: string(255) }
  relations:
      Artiste:
          local: artiste_id
          foreign: id
          foreignAlias: Artistes
      TypeOeuvre:
          local: type_oeuvre_id
          foreign: id
          foreignAlias: TypeOeuvres
 
TypeOeuvre:
  actAs: { Timestampable: ~ }
  columns:
      nom: { type: string(255) }
La description d'erreur de la doc MySql ne m'aide pas du tout et je ne trouve pas d'info sur ce genre de manip...

Help !