Note that there are some explanatory texts on larger screens.

plurals
  1. POSQL error foreign key constraint
    primarykey
    data
    text
    <p>I'm struggling for four days days now with an sql foreign key constraint fails and I reaaly have no idea why. I've read all I could about that subject and it seems that everything is fine.</p> <p>Here is my schema.yml</p> <pre><code>Soiree: actAs: { Timestampable: ~ } columns: titre: { type: string(255), notnull: true } description: { type: blob(), notnull: true } adresse: { type: string(255), notnull: true, unique: true } code_postal: {type: integer, notnull: true } ville: {type: string(255), notnull:true} date: {type: timestamp, notnull: true } type_id: {type: integer, notnull: true } flyer: {type: string(255), notnull:true } is_visible: { type: boolean, notnull:true, default:0 } user_id: {type:integer, notnull: true} relations: sfGuardUser: {onDelete: CASCADE, local: user_id, foreign: id, foreignAlias: Users} Type: {onDelete: CASCADE, local: type_id, foreign: id, alias: Types, class: Type, refClass: Soiree} Type: columns: titre: {type: string(255), notnull: true} Invitation: actAs: { Timestampable: ~ } columns: titre: { type: string(255), notnull: true } description: { type: blob(), notnull: true } image: { type: string(255), notnull: true } is_sent: {type: boolean, notnull:true, default:0} adresse: { type: string(255) } code_postal: { type: string(255) } code_QR: {type: string(255), notnull: true } invites_id: {type:integer } user_id: {type:integer, notnull: true} groupe_invites_id : {type:integer, notnull: true } soiree_id: {type:integer, notnull:true} relations: Invites: { onDelete: CASCADE, local: invites_id, foreign: id, alias: invite, class: Invites, refClass: Invitation } Groupe_invites: { onDelete: CASCADE, local: groupe_invites_id, foreign: id, alias: invit_groupes, class: Groupe_invites, refClass: Invitation } sfGuardUser: {onDelete: CASCADE, local: user_id, foreign: id, foreignAlias: Users} Soiree: { onDelete: CASCADE, local: soiree_id, foreign: id, alias :Soirees, class: Soiree, refClass: Invitation } Groupe_invites: actAs: { Timestampable: ~ } columns: titre: { type: string(255), notnull: true } description: { type: string(255), notnull: true, unique: true } invites_id: { type: integer, notnull: true } soiree_id: { type: integer } user_id: {type:integer, notnull: true} relations: Invites: onDelete: CASCADE local: invites_id foreign: id alias: invites class: Invites refClass: Groupe_invites sfGuardUser: {onDelete: CASCADE, local: user_id, foreign: id, foreignAlias: Users} Soiree: { onDelete: CASCADE, local: soiree_id, foreign: id, alias: Soiree, class: Soiree, refClass: Groupe_invites } Invites: columns: nom: { type: string(255), notnull: true } prenom: { type: string(255), notnull: true } age: {type: integer, notnull : true } email: {type: string(255), notnull: true, unique: true } adresse: {type: blob(), notnull: true } telephone: {type: integer(255), notnull: true } soiree_id: {type: integer, notnull: true } user_id: {type:integer, notnull: true} relations: sfGuardUser: {onDelete: CASCADE, local: user_id, foreign: id, foreignAlias: Users} Soiree: { onDelete: CASCADE, local: soiree_id, foreign: id, alias: Soiree_invite, class: Soiree, refClass: Invites } Organisateur: actAs: {Timestampable: ~ } columns: nom: {type: string(255), notnull: true } prenom: {type: string(255), notnull: true } age: {type: integer, notnull: true } description: {type: blob(), notnull: true } photo: {type: string(255), notnull: true } user_id: {type:integer, notnull: true} relations: sfGuardUser: {onDelete: CASCADE, local: user_id, foreign: id, foreignAlias: Users} Image: columns: titre: {type: string(255), notnull: true } description: {type: string(255), notnull: true } lien: {type: string(255)} album_id: {type: integer} user_id: {type: integer} relations: Album: {onDelete: CASCADE, local: album_id, foreign: id, alias: Albums, class:Album, refClass:Image} sfGuardUser: {onDelete: CASCADE, local: user_id, foreign: id} Album: columns: titre: {type: string(255), notnull: true } description: {type: blob(), notnull: true } user_id: {type:integer, notnull: true} relations: sfGuardUser: {onDelete: CASCADE, local: user_id, foreign: id} </code></pre> <p>And I have an error of type:</p> <p>SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (<code>soiree</code>.<code>invitation</code>, CONSTRAINT <code>invitation_ibfk_1</code> FOREIGN KEY (<code>invites_id</code>) REFERENCES <code>invitation</code> (<code>id</code>) ON DELETE CASCADE)</p> <p>I really need help on this one, thank you !</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload