I'll be doing this in sqlite now that they support foreign keys and tsql and perhaps mysql.
Is it illegal to do something like
CREATE TABLE comment(
id integer primary key,
parent integer references(comment.id),
author integer references(User.id),
desc varchar(max),
hidden bit
deleted bit
);
where parent may be 0 or null because it is the root and does not have a parent? AFAIK i wont be deleting any comments but will set it to hidden or as deleted
. I mostly want to know if i can have the root as 0 or null otherwise i have no idea how i can have the comment have a reference a parent (i cant make the first one point to itself?).