

CREATE TABLE Topics (
    topicId INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
    topicTitle varchar (255) NOT NULL,
    topicTIme VARCHAR(255) NOT NULL,
);

CREATE TABLE Posts (
    postId INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
    topicId INT NOT NULL,
    postText TEXT,
    postTime datetime,
    postTopic INT(8) NOT NULL,
    postOP varchar(150)
);

INSERT INTO Topics (topicTitle,topicTime, topicOP) VALUES('test1',NOW(), 'tOP');

ALTER TABLE Posts ADD FOREIGN KEY(postText) REFERENCES Topics(topicId) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE Posts ADD FOREIGN KEY(postOP) REFERENCES finalUser(id) ON DELETE RESTRICT ON UPDATE CASCADE;
