CREATE TABLE IF NOT EXISTS repo_deploy_key (
    id BIGSERIAL PRIMARY KEY,
    repo UUID NOT NULL REFERENCES repo(id),
    title TEXT NOT NULL,
    public_key TEXT NOT NULL,
    fingerprint TEXT NOT NULL,
    key_type TEXT NOT NULL,
    key_bits INTEGER,
    read_only BOOLEAN NOT NULL DEFAULT TRUE,
    last_used_at TIMESTAMPTZ,
    expires_at TIMESTAMPTZ,
    is_revoked BOOLEAN NOT NULL DEFAULT FALSE,
    created_by UUID NOT NULL,
    created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
    updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
