CREATE TABLE IF NOT EXISTS user_activity_log (
    id BIGSERIAL PRIMARY KEY,
    user_uid UUID,
    action VARCHAR(255) NOT NULL,
    ip_address VARCHAR(255),
    user_agent VARCHAR(255),
    details JSONB NOT NULL,
    created_at TIMESTAMPTZ NOT NULL
);

CREATE INDEX idx_user_activity_log_user_uid ON user_activity_log (user_uid);
CREATE INDEX idx_user_activity_log_created_at ON user_activity_log (created_at);
