DROP TABLE IF EXISTS documents;
CREATE TABLE documents (
    [docid]     INTEGER NOT NULL PRIMARY KEY,
    [mime]      VARCHAR(256) DEFAULT 'application/octet-stream',
    [reference] VARCHAR(1024) NOT NULL,
    [filename]  VARCHAR(1024) NOT NULL,
    [data]      BLOB,
    [created]   TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
