I am trying to create some tables in HeidiSql, but got stuck at the point I noticed that I can not create foreign keys. At first I tried it with SQL statements and later on with the key generation menu of HeidiSql. Both ended in giving me an index instead of a foreign key for the specified column.
Here is an example:
CREATE TABLE Test(
testId INT NOT NULL,
PRIMARY KEY(testId));
CREATE TABLE secondTest(
secondTestId INT NOT NULL,
test INT NOT NULL,
FOREIGN KEY(test) REFERENCES Test(testId),
PRIMARY KEY(secondTestId));
I do not get any error message, all it does is converting the foreign key, the symbol of the foreign key shows up until I save the table, into a index. Furthermore, it does not apply check constraints if specify one for a column. Has anyone faced the same problem yet? Thank you for your help!