2010-05-28 9 views
0

Doctrine에 대한 무결성 제약 조건 위반이 발생하지만 실제로 이유는 알 수 없습니다.Doctrine의 "SQLSTATE [23000] : 무결성 제약 조건 위반"

schema.yml 파일

User: 
    columns: 
    id: 
     type: integer 
     primary: true 
     autoincrement: true 
    username: 
     type: varchar(64) 
     notnull: true 
    email: 
     type: varchar(128) 
     notnull: true 
    password: 
     type: varchar(128) 
     notnull: true 
    relations: 
    Websites: 
     class: Website 
     local: id 
     foreign: owner 
     type: many 
     foreignType: one 
     onDelete: CASCADE 

Website: 
    columns: 
    id: 
     type: integer 
     primary: true 
     autoincrement: true 
    active: 
     type: bool 
    owner: 
     type: integer 
     notnull: true 
    plz: 
     type: integer 
     notnull: true 
    longitude: 
     type: double(10,6) 
     notnull: true 
    latitude: 
     type: double(10,6) 
     notnull: true 
    relations: 
    Owner: 
     type: one 
     foreignType: many 
     class: User 
     local: owner 
     foreign: id 

그리고 여기가

Model_User: 
    User_1: 
    username: as 
    email: as****.com 
    password: ***** 

Model_Website: 
    Website_1: 
    active: true 
    plz: 34222 
    latitude: 13.12 
    longitude: 3.56 
    Owner: User_1 

답변

0

좋아 내 데이터기구 (data.yml)가, 내가 문제를 발견합니다. 이 오류에 대한 이유는 교리가 모델에 이미 존재하는 속성을 추가하려고 그럼 내가 이미 Model_User을 변경하고 특성 "소유자"를 추가 한이었다.

길고도 짧은 이야기 : 뿐만 아니라 당신의 YAML 스키마에 존재하여 모델의 변수를 정의하지 마십시오!

관련 문제