CREATE TABLE IF NOT EXISTS `city` (
    `id` INT(30) NOT NULL AUTO_INCREMENT,
    `name` VARCHAR(64) NOT NULL,
    `zip` VARCHAR(5) 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 `users` (
    `id` INT(30) NOT NULL AUTO_INCREMENT,
    `name` VARCHAR(64) NOT NULL,
    `cityId` INT(30),
    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,
    FOREIGN KEY (`cityId`) REFERENCES city(`id`),
    PRIMARY KEY(`id`)
);