mike-backend / backend /migrations /004_comment_reply_parent_reply_id.sql
bardd's picture
Deploy Mike backend-only Space
06671aa verified
Raw History Blame Contribute Delete
654 Bytes
-- Add portal reply-to-reply support for Comments & Issues.
-- parent_word_comment_id remains for imported Word reply hierarchy.
-- parent_reply_id is used when a portal reply is replying to another portal/Word reply row.
alter table public.document_comment_replies
add column if not exists parent_reply_id uuid
references public.document_comment_replies(id)
on delete set null;
create index if not exists document_comment_replies_parent_reply_idx
on public.document_comment_replies(parent_reply_id);
create index if not exists document_comment_replies_thread_parent_reply_idx
on public.document_comment_replies(thread_id, parent_reply_id);