Bonsoir à tous,
je bosse depuis quelques jours avec le génial framework symfony & doctrine, après beaucoup de lecture j'essaye d'avancer mais je suis surtout très vite bloqué

J'ai rédigé le schema.yml et tente de l'appliquer mais au moment de créer les contraintes y'a problème.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
SQLSTATE[HY000]: General error: 1005 Can't create table '7Affaire.#sql-390_181' (errno: 150). Failing Query: "ALTER TABLE infoimmoannonce ADD CONSTRAINT infoimmoannonce_immotypebien_id_immotypebien_id FOREIGN KEY (immotypebien_id) REFERENCES immotypebien(id)". Failing Query: ALTER TABLE infoimmoannonce ADD CONSTRAINT infoimmoannonce_immotypebien_id_immotypebien_id FOREIGN KEY (immotypebien_id) REFERENCES immotypebien(id)
mon fichier schema.yml :
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
 
---
detect_relations: true
options:
  type: InnoDB
 
annonce:
  actAs: { Timestampable: ~ }
  columns:
    typeannonce_id:
      type: integer(4)
      notnull: true
    categorieannonce_id:
      type: integer(4)
      notnull: true
    region_id:
      type: integer(4)
      notnull: true
    departement_id:
      type: integer(4)
      notnull: true
    postal_code_id:
      type: string(5)
      notnull: true
    m_path_id:
      type: string(300)
      notnull: true
    url:
      type: string(100)
      notnull: true
    title:
      type: string(100)
      notnull: true
    content:
      type: string(1500)
      notnull: true
    sell_price: integer(4)
    tag: string(200)
    email:
      type: string(100)
      notnull: true
    password:
      type: string(100)
      notnull: true
    is_activated: boolean
    is_weekly_up: boolean
    is_urgent: boolean
    upped_at:
      type: timestamp
      notnull: true
  relations:
    typeannonce:
      foreignAlias: annonces
    categorieannonce:
      foreignAlias: annonces
    region:
      foreignAlias: annonces
    departement:
      foreignAlias: annonces
 
categorieannonce:
  columns:
    name:
      type: string(100)
      notnull: true
 
infoimmoannonce:
  actAs: { Timestampable: ~ }
  columns:
    immotypebien_id:
      type: integer(4)
      notnull: true
    immotypeannonce_id:
      type: integer(4)
      notnull: true
    annonce_id:
      type: integer(4)
      notnull: true
    surface:
      type: integer(4)
      notnull: true
    nb_room:
      type: integer(4)
      notnull: true
  relations:
    annonce:
      foreignAlias: annonce
    immotypeannonce:
      foreignAlias: infoimmoannonces
    immotypebien:
      foreignAlias: infoimmoannonces
 
infovehannonce:
  actAs: { Timestampable: ~ }
  columns:
    vehtypeboite_id:
      type: integer(4)
      notnull: true
    vehtypealimentation_id:
      type: integer(4)
      notnull: true
    annonce_id:
      type: integer(4)
      unique: true
      notnull: true
    kilometrage:
      type: integer(4)
      notnull: true
    annee:
      type: integer(4)
      notnull: true
  relations:
    annonce:
      foreignAlias: annonce
    vehtypealimentation:
      foreignAlias: infovehannonces
    vehtypeboite:
      foreignAlias: infovehannonces
 
typeannonce:
  columns:
    name:
      type: string(20)
      notnull: true
 
vehtypealimentation:
  columns:
    name:
      type: string(20)
      unique: true
      notnull: true
 
vehtypeboite:
  columns:
    name:
      type: string(20)
      unique: true
      notnull: true
 
immotypebien:
  columns:
    name:
      type: string(20)
      notnull: true
 
immotypeannonce:
  columns:
    name:
      type: string(20)
      notnull: true
 
region:
  columns:
    name:
      type: string(50)
      notnull: true
 
departement:
  columns:
    name:
      type: string(100)
      notnull: true
    numero:
      type: string(2)
      notnull: true
J'ai tenté d'éxecuter le sql généré dans phpmyadmin mais il ne me donne pas plus de précision quant au problème.
Voyez-vous une erreur grossière dans mon code ?
Je me suis pas mal re-lus mais là je sèche ... ciao et merci !