CREATE TABLE files
(
    id    INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
    hash  BLOB                              NOT NULL,
    path  VARCHAR                           NOT NULL,
    valid BOOLEAN                           NOT NULL DEFAULT TRUE,
    added DATETIME                          NOT NULL,
    size  BIGINT                            NOT NULL,
    mtime DATETIME                          NULL
);

CREATE INDEX files_hash ON files (hash);
CREATE INDEX files_valid ON files (valid);