I want to create a references to foreign table. but i\'m getting the following error:
query:
CREATE TABLE category_ids (id INT, post_id INT,
This error can also come when parent table is partitioned. Removing partitioning from the parent table allows foreign constraint to be created without any problem.
Only InnoDB supports Foreign keys, MyISAM doesn't. Even if it would, you cannot create relations between tables of different type.
Therefore you need to convert the table post
into InnoDB. ALTER TABLE post ENGINE = InnoDB;
For me works with this.
CREATE TABLE category_ids (id INT, post_id INT references post(id),
INDEX par_ind (post_id)
) ENGINE=INNODB;