2 -- Need to regenerate user_view, user_mview
3 DROP VIEW user_view CASCADE;
5 -- Remove the fedi_name constraint, drop that useless column
7 DROP CONSTRAINT user__name_fedi_name_key;
10 DROP COLUMN fedi_name;
14 DROP CONSTRAINT community_name_key;
16 CREATE VIEW user_view AS
26 u.send_notifications_to_email,
34 p.creator_id = u.id) AS number_of_posts,
37 coalesce(sum(score), 0)
43 AND p.id = pl.post_id) AS post_score,
50 c.creator_id = u.id) AS number_of_comments,
53 coalesce(sum(score), 0)
59 AND c.id = cl.comment_id) AS comment_score
63 CREATE MATERIALIZED VIEW user_mview AS
69 CREATE UNIQUE INDEX idx_user_mview_id ON user_mview (id);