use jstaggs


CREATE TABLE Topics(
    topic_id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
    topic_name VARCHAR(255),
    topic_type VARCHAR(255),
    topic_info VARCHAR(255) 
);

CREATE TABLE Posts(
    post_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
    post_topic INT UNSIGNED NOT NULL,
    post_member INT UNSIGNED NOT NULL,
    post_title VARCHAR(255),
    post_body VARCHAR(255),
    FOREIGN KEY (post_topic) REFERENCES Topics(topic_id),
    PRIMARY KEY (post_id)
);

CREATE TABLE Comments(
    comment_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
    comment_topic INT UNSIGNED NOT NULL,
    comment_post INT UNSIGNED NOT NULL,
    comment_member INT UNSIGNED NOT NULL,
    comment_body VARCHAR(255),
    FOREIGN KEY (comment_topic) REFERENCES Topics(topic_id),
    FOREIGN KEY (comment_post) REFERENCES Posts(post_id),
    PRIMARY KEY (comment_id, comment_post)
);

INSERT INTO Topics (topic_name,topic_type,topic_info) VALUES(
    'General','General','Off-topic or other discussion.'
);
INSERT INTO Topics (topic_name,topic_type,topic_info) VALUES(
    'Vincent Van Gogh','Painter','painter info here'
);
INSERT INTO Topics (topic_name,topic_type,topic_info) VALUES(
    'Claude Monet','Painter','painter info here'
);
INSERT INTO Topics (topic_name,topic_type,topic_info) VALUES(
    'Impressionism','Style','style info here'
);
INSERT INTO Topics (topic_name,topic_type,topic_info) VALUES(
    'Cubism','Style','style info here'
);
INSERT INTO Topics (topic_name,topic_type,topic_info) VALUES(
    'Pablo Picasso','Painter','painter info here'
);
INSERT INTO Posts (post_topic,post_member,post_title,post_body) VALUES(
    1,1,'TEST','This is an example general post.'
);
INSERT INTO Posts (post_topic,post_member,post_title,post_body) VALUES(
    1,1,'TEST','This is another general post.'
);

INSERT INTO Posts (post_topic,post_member,post_title,post_body) VALUES(
    2,1,'TEST','This is an example general post.'
);
INSERT INTO Posts (post_topic,post_member,post_title,post_body) VALUES(
    3,1,'TEST','This is an example general post.'
);
INSERT INTO Posts (post_topic,post_member,post_title,post_body) VALUES(
    4,1,'TEST','This is an example general post.'
);
INSERT INTO Posts (post_topic,post_member,post_title,post_body) VALUES(
    5,1,'TEST','This is an example general post.'
);


INSERT INTO Comments(comment_post,comment_topic,comment_member,comment_body) VALUES (
    1,1,1,'This is a comment.'
);
INSERT INTO Comments(comment_post,comment_topic,comment_member,comment_body) VALUES (
    1,1,1,'This is a second comment.'
);
INSERT INTO Comments(comment_post,comment_topic,comment_member,comment_body) VALUES (
    2,1,1,'This is a second comment.'
);
