음소거 이유

사용자가 무음 처리(silenced)된 이유를 조회해야 했습니다. 이름에 __silence__가 포함된 필드를 찾아보려고 추측을 해봤지만, 아직 해당 필드가 보이지 않습니다:

select t.table_schema,
       t.table_name
from information_schema.tables t
inner join information_schema.columns c on c.table_name = t.table_name
                                and c.table_schema = t.table_schema
where c.column_name LIKE 'silence%'
      and t.table_schema not in ('information_schema', 'pg_catalog')
      and t.table_type = 'BASE TABLE'
order by t.table_schema;

다음과 같이 시도해 보세요:

SELECT acting_user_id, target_user_id AS silenced_user_id, details AS reason, created_at
FROM user_histories
WHERE user_histories.action = 30

감사합니다. user_histories를 확인해야 한다는 생각을 못 했어요. 그 테이블이 사용자의 활동 기록이 아니라, 사용자에게 적용된 조치의 기록일 줄 몰랐거든요.