We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 95a67bd commit 2b8e04eCopy full SHA for 2b8e04e
1 file changed
migrations/tenant/0033-note-history@add-initial-note-history-records-for-notes.sql
@@ -0,0 +1,6 @@
1
+-- Insert note history records for notes that do not have them
2
+INSERT INTO public.note_history (note_id, user_id, tools, content)
3
+ SELECT n.id, n.creator_id, n.tools, n.content
4
+ FROM public.notes n
5
+ LEFT JOIN public.note_history nh ON n.id = nh.note_id
6
+ WHERE nh.note_id IS NULL;
0 commit comments