Bonjour,

Je suis tout nouveau sur symfony et doctrine. Je suis en train de me former en fait sur un mini projet perso de gestion de factures et de devis...

Je rencontre en ce moment un problème au chargement des données de test, au moment de la configuration du projet. Quand je fais :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
$ php symfony doctrine:build --all --and-load
j'obtiens le message d'erreur suivant :
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`smith`.`facture`, CONSTRAINT `facture_client_id_client_id` FOREIGN KEY (`client_id`) REFERENCES `client` (`id`))
Comme je ne suis pas spécialiste de SQL, j'avoue avoir un peu de difficulté à comprendre ce message. Mais la valeur de CONSTRAINT me semble étrange. Et en bref ça bloque, les données ne sont pas insérées...

Je ne sais pas si le schema.yml peut être en cause alors je le copie ci-dessous :
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
Client:
 actAs: { Timestampable: ~ }
 columns:
  nom: { type: string(255), notnull: true }
  adresse1: { type: string(255), notnull: true }
  adresse2: { type: string(255) }
  cp: { type: string(255), notnull: true }
  ville: { type: string(255), notnull: true }
  pays: { type: string(255), notnull: true, default: "France" }
  siret: { type: string(155) }
 
Contact:
 actAs: { Timestampable: ~ }
 columns:
  civilite:
   type: enum
   length: 3
   values: ['M.','Mme','Melle']
  nom: { type: string(255), notnull: true }
  prenom: { type: string(255), notnull: true }
  fonction: { type: string(255) }
  tel: { type: string(255) }
  gsm: { type: string(255) }
  fax: { type: string(255) }
  courriel: { type: string(255) }
  client_id: { type: integer, notnull: true }
 relations:
  Client: { local: client_id, foreign: id, foreignAlias: Clients }
 
Facture:
 actAs: { Timestampable: ~ }
 columns:
  numero: { type: integer, notnull: true }
  prestation: { type: string(255), notnull: true }
  client_id: { type: integer, notnull: true }
  echeance: { type: date, notnull: true }
  devis: { type: boolean, notnull: true, default: true }
  payee: { type: date }
 relations:
  Client: { local: client_id, foreign: id, foreignAlias: Factures }
 
EntreeFacture:
 actAs: { Timestampable: ~ }
 columns:
  facture_id: { type: integer, notnull: true }
  designation: { type: string(255), notnull: true }
  montant_ht:
   type: decimal(6)
   scale: 2
 relations:
  Facture: { local: facture_id, foreign: id, foreignAlias: Entrees }
Merci d'avance pour votre aide