published -> Timestamp,
updated -> Nullable<Timestamp>,
post_id -> Int4,
+ current_comment_text -> Text,
community_id -> Int4,
creator_name -> Varchar,
comment_creator_id -> Int4,
pub published: chrono::NaiveDateTime,
pub updated: Option<chrono::NaiveDateTime>,
pub post_id: i32,
+ pub current_comment_text: String,
pub community_id: i32,
pub creator_name: String,
pub comment_creator_id: i32,
resolver_id -> Nullable<Int4>,
published -> Timestamp,
updated -> Nullable<Timestamp>,
+ current_post_name -> Varchar,
+ current_post_url -> Nullable<Text>,
+ current_post_body -> Nullable<Text>,
community_id -> Int4,
creator_name -> Varchar,
post_creator_id -> Int4,
pub resolver_id: Option<i32>,
pub published: chrono::NaiveDateTime,
pub updated: Option<chrono::NaiveDateTime>,
+ pub current_post_name: String,
+ pub current_post_url: Option<String>,
+ pub current_post_body: Option<String>,
pub community_id: i32,
pub creator_name: String,
pub post_creator_id: i32,
comment_text text not null,
reason text not null,
resolved bool not null default false,
- resolver_id int references user_ on update cascade on delete cascade not null, -- user resolving report
+ resolver_id int references user_ on update cascade on delete cascade, -- user resolving report
published timestamp not null default now(),
updated timestamp null,
unique(comment_id, creator_id) -- users should only be able to report a comment once
post_body text,
reason text not null,
resolved bool not null default false,
- resolver_id int references user_ on update cascade on delete cascade not null, -- user resolving report
+ resolver_id int references user_ on update cascade on delete cascade, -- user resolving report
published timestamp not null default now(),
updated timestamp null,
unique(post_id, creator_id) -- users should only be able to report a post once
create or replace view comment_report_view as
select cr.*,
c.post_id,
+c.content as current_comment_text,
p.community_id,
f.name as creator_name,
u.id as comment_creator_id,
create or replace view post_report_view as
select pr.*,
+p.name as current_post_name,
+p.url as current_post_url,
+p.body as current_post_body,
p.community_id,
f.name as creator_name,
u.id as post_creator_id,