USE fingerprint;

CREATE TABLE IF NOT EXISTS user (
    id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
    first_name VARCHAR(24) NOT NULL,
    last_name VARCHAR(24) NOT NULL,
    created DATETIME NOT NULL,
    updated DATETIME,
    active BOOL NOT NULL DEFAULT true
);

CREATE TABLE IF NOT EXISTS template (
    id TINYINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
    user_id MEDIUMINT UNSIGNED REFERENCES user(id),
    template_id TINYINT UNSIGNED NOT NULL,
    template BINARY(64) NOT NULL,
    created DATETIME NOT NULL,
    updated DATETIME
);
