CREATE TABLE bundles (
    id SEQUENCE PRIMARY KEY,
    encrypted BOOLEAN NOT NULL DEFAULT FALSE,
    expires TIMESTAMPTZ DEFAULT NULL
);
ALTER SEQUENCE bundles_id_seq RESTART WITH -2147483648;

CREATE TABLE files (
    id SEQUENCE PRIMARY KEY,
    bundle INTEGER NOT NULL,
    name VARCHAR(30) NOT NULL,
    mime VARCHAR(255) NOT NULL
);
ALTER SEQUENCE files_id_seq RESTART WITH -2147483648;

CREATE TABLE links (
    shortid VARCHAR(8) PRIMARY KEY,
    target VARCHAR(2047) NOT NULL,
    encrypted BOOLEAN NOT NULL DEFAULT FALSE
);
