I have a problem with my DB (InnoDB). I have two tables:
table1{
id1 INT..
..
PRIMARY KEY (id1)
}
table2{
fk INT..
...
FOREIGN KEY (FK) REFERENCES table1(id1)
ON DELETE CASCADE
ON UPDATE CASCADE
}
Now...when I change a record into table1 the records in table2 are deleted! I don't want this behavior. How can I change this?
I read that "InnoDB allows a foreign key constraint to reference a non-unique key". My key is unique. How can I change this?
Thank you!