CREATE TABLE IF NOT EXISTS `authors` (
    `id` INT(30) NOT NULL AUTO_INCREMENT,
    `firstname` VARCHAR(64) NOT NULL,
    `lastname` VARCHAR(64) NOT NULL,
    deleted BOOLEAN NOT NULL DEFAULT FALSE,
    editorId INT NULL,
    created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY(`id`)
    );

CREATE TABLE IF NOT EXISTS `posts` (
    `id` INT(30) NOT NULL AUTO_INCREMENT,
    `authorId` INT(30) NOT NULL REFERENCES `authors`(`id`) ON DELETE CASCADE,
    `title` TEXT NOT NULL,
    `content` TEXT NOT NULL,
    deleted BOOLEAN NOT NULL DEFAULT FALSE,
    editorId INT NULL,
    created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY(`id`)
);