summaryrefslogtreecommitdiff
path: root/migrations/3_fix_lazychat_message_visibility.sql
blob: 9f200ef6c0352c5c375995110adca4e68c5a3c3e (plain)
1
2
3
4
5
6
7
CREATE OR REPLACE VIEW user_visible_lazychat_messages AS
   SELECT eur.user, t.message
     FROM effective_user_roles eur, lazychat_targets t
    WHERE t.target = eur.role
  UNION
    SELECT m.author, m.id
    FROM lazychat_messages m;