CREATE TABLE audit_logs ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), actor_id UUID, actor_role TEXT, action TEXT NOT NULL, target_table TEXT, target_id UUID, details JSONB, ip_address INET, user_agent TEXT, timestamp TIMESTAMPTZ DEFAULT NOW() );