DROP TABLE IF EXISTS WROX_BLOG_COMMENT;
DROP TABLE IF EXISTS WROX_BLOG_POST;

CREATE TABLE WROX_BLOG_POST (
    POST_ID       INTEGER UNSIGNED  NOT NULL  AUTO_INCREMENT,
    POST_TITLE    VARCHAR(50)       NOT NULL,
    POST_TEXT     TEXT              NOT NULL,
    POST_DATE     TIMESTAMP         DEFAULT CURRENT_TIMESTAMP,

    PRIMARY KEY (POST_ID)
)
ENGINE=MyISAM DEFAULT CHARACTER SET latin1
    COLLATE latin1_general_cs AUTO_INCREMENT=0;

CREATE TABLE WROX_BLOG_COMMENT (
    POST_ID       INTEGER UNSIGNED  NOT NULL,
    PERSON_NAME   VARCHAR(50)       NOT NULL,
    POST_COMMENT  VARCHAR(255)      NOT NULL,
    COMMENT_DATE  TIMESTAMP         DEFAULT CURRENT_TIMESTAMP,

    FOREIGN KEY (POST_ID)
        REFERENCES WROX_BLOG_POST(POST_ID)
)
ENGINE=MyISAM DEFAULT CHARACTER SET latin1
    COLLATE latin1_general_cs;