summaryrefslogtreecommitdiff
path: root/migrations/3_fix_lazychat_message_visibility.sql
blob: 4af6b3017d2fd561bccd696084b067036635fcf3 (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.message
    FROM lazychat_messages m;