CREATE TABLE IF NOT EXISTS fragments (
    id TEXT NOT NULL PRIMARY KEY,
    mime TEXT NOT NULL,
    blob BYTEA NOT NULL
);

CREATE TABLE IF NOT EXISTS document_fragments (
    domain TEXT NOT NULL,
    path TEXT NOT NULL,
    version DATE NOT NULL,
    fragment TEXT NOT NULL,
    PRIMARY KEY (domain, path, version, fragment)
);
