
Originally Posted by
Muller2
... but how would I go about dealing with the categories?
they would be in a separate table, and there would be a many-to-many relationship table to relate posts to categories
Code:
CREATE TABLE posts
( id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT
, in_reply_to INTEGER NULL
, title VARCHAR(255) NOT NULL
, descr VARCHAR(255) NULL
, url VARCHAR(255) NULL
, added DATETIME NOT NULL
, chged DATETIME NOT NULL
, other_columns ...
, UNIQUE titles_ux ( title )
, KEY in_reply_to_ix ( in_reply_to )
, FOREIGN KEY in_reply_to_fk ( in_reply_to )
REFERENCES posts ( id )
) TYPE=InnoDB
;
Bookmarks