Problème de relation 1-1 avec Doctrine
Bonsoir,
J'ai un problème de relation avec trois tables.
Voici comment elles se présentent :
Citation:
Boulangeries (ma liste de boulangerie)
- id
- nom
Citation:
Pain (Les pains présent dans les boulangeries)
- id
- Boulangerie_id
- TypeDePain_id
Citation:
TypeDePain (Pain coupé, pain rond...)
- id
- nom
Mon problème : il considère mon champ "TypePain_id" comme unique.
Du coup si j'ai 3 TypeDePain je ne peux pas rajouter plus de 3 Pains!
Voici mon schema.yml
Code:
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
| Boulangerie:
columns:
id:
primary: true
type: integer(5)
autoincrement: true
title:
type: string(255)
BoulangeriePain:
columns:
id:
primary: true
type: integer(5)
autoincrement: true
Boulangerie_id:
type: integer(5)
notnull: true
BoulangeriePainType_id:
unique: false
type: integer(5)
notnull: true
relations:
Boulangerie:
local: Boulangerie_id
foreign: id
BoulangeriePainType:
local: BoulangeriePainType_id
foreign: id
BoulangeriePainType:
columns:
id:
primary: true
type: integer(5)
notnull: true
autoincrement: true
title:
type: string(150)
description:
type: string |
Le schema me semble bon pourtant... ?
Merci.