Peter Brawley Wrote:
-------------------------------------------------------
> It's not a denormalisation issue.
>
> You say the relation of post to comment is 1:many.
> Then your comment FK is misformed, referencing the
> comment table instead of the post table.
>
> You need ...
>
>
> CREATE TABLE post (
> id INT UNSIGNED NOT NULL AUTO_INCREMENT,
> body TEXT NOT NULL,
> issue_id INT UNSIGNED NOT NULL,
> PRIMARY KEY (id)
> );
>
> CREATE TABLE comment (
> id int unsigned NOT NULL AUTO_INCREMENT,
> post_id int unsigned NOT NULL,
> body text COLLATE utf8_bin NOT NULL,
> PRIMARY KEY (id),
> FOREIGN KEY (post_id) REFERENCES post(id)
> );
Certainly it was a typo. My question remains unaswered.
--
http://freesoft.portonvictor.org