MySQL Error 1215: Cannot add foreign key constraint

前端 未结 30 3399
予麋鹿
予麋鹿 2020-11-22 01:37

I am trying to forward engineer my new schema onto my db server, but I can\'t figure out why I am getting this error. I\'ve tried to search for the answer here, but everyth

30条回答
  •  面向向阳花
    2020-11-22 02:25

    I can not find this error

    CREATE TABLE RATING (
    
    Riv_Id INT(5),
    Mov_Id INT(10) DEFAULT 0,
    Stars INT(5),
    Rating_date DATE, 
    
    PRIMARY KEY (Riv_Id, Mov_Id),
    
    FOREIGN KEY (Riv_Id) REFERENCES REVIEWER(Reviewer_ID)
    ON DELETE SET NULL ON UPDATE CASCADE,
    
    FOREIGN KEY (Mov_Id) REFERENCES MOVIE(Movie_ID)
    ON DELETE SET DEFAULT ON UPDATE CASCADE
    )
    

提交回复
热议问题