SQLの外部キー制約が失敗して4日間苦労しています。私は理由を知りません。私はその件について私ができることをすべて読んだので、すべてがうまくいくように思えます。ここで SQLエラーの外部キー制約
は私のschema.ymlの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}
であると私はタイプのエラーを持っている:
SQLSTATE [23000]:整合性制約違反:1452追加または子行を更新できません:外部キーを制約が失敗した(soiree
を。invitation
、CONSTRAINT invitation_ibfk_1
FOREIGN KEY(invites_id
)DELETE CASCADE ON invitation
(id
)を参照)
Iレアちょっとこれに助けが必要です、ありがとう!
あなたが備品をアップロードしようとしているときにこのエラーメッセージが発生しますか? – Tom