CREATE TABLE IF NOT EXISTS user_ssh_key (
    id BIGSERIAL PRIMARY KEY,
    "user" UUID NOT NULL,
    title VARCHAR(255) NOT NULL,
    public_key TEXT NOT NULL,
    fingerprint VARCHAR(255) NOT NULL,
    key_type VARCHAR(255) NOT NULL,
    key_bits INTEGER,
    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,
    updated_at TIMESTAMPTZ NOT NULL
);

CREATE INDEX idx_user_ssh_key_user ON user_ssh_key ("user");
