CREATE TABLE IF NOT EXISTS user_gpg_key (
    id BIGSERIAL PRIMARY KEY,
    "user" UUID NOT NULL REFERENCES "user"(id),
    title TEXT NOT NULL,
    public_key TEXT NOT NULL,
    fingerprint TEXT NOT NULL,
    key_id TEXT NOT NULL,
    primary_key_id TEXT,
    emails TEXT NOT NULL,
    is_verified BOOLEAN NOT NULL DEFAULT FALSE,
    last_used_at TIMESTAMPTZ,
    expires_at TIMESTAMPTZ,
    is_revoked BOOLEAN NOT NULL DEFAULT FALSE,
    created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
    updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
