I am trying to create a table with a named constrained, however it is not being created. I tracked the problem to be in this line:
CONSTRAINT $fk_post_id_lik FOREIGN KEY(post_id) REFERENCES $posts (global_id)
where $posts is the name of a table created before. Does anyone know what could be wrong?
Turns out the table $posts was being created AFTER this one, for which, when this table was being created, it did not find the required table. Silly mistake.