diff --git a/backend/documents/migrations/0014_migrate_comments_to_communications.py b/backend/documents/migrations/0014_migrate_comments_to_communications.py index 4fc9aa24..56bcec88 100644 --- a/backend/documents/migrations/0014_migrate_comments_to_communications.py +++ b/backend/documents/migrations/0014_migrate_comments_to_communications.py @@ -10,7 +10,8 @@ def migrate_comments_forward(apps, schema_editor): schema_editor.execute(""" INSERT INTO communications_chat ( type, name, created_by_id, can_reply, flags, - context_content_type_id, context_object_id + context_content_type_id, context_object_id, + created_at, is_main, is_blocked, include_all_users, extra_data ) SELECT DISTINCT 'comments', @@ -19,7 +20,12 @@ def migrate_comments_forward(apps, schema_editor): TRUE, '{"allow_replies": true, "allow_reactions": true, "allow_attachments": true, "allow_editing": true}'::jsonb, (SELECT id FROM django_content_type WHERE app_label='documents' AND model='document'), - dc.document_id + dc.document_id, + NOW(), + FALSE, + FALSE, + FALSE, + '{}'::jsonb FROM documents_documentcomment dc JOIN documents_document d ON d.id = dc.document_id WHERE NOT EXISTS ( diff --git a/backend/feed/migrations/0006_migrate_comments_to_communications.py b/backend/feed/migrations/0006_migrate_comments_to_communications.py index 9d11e31b..3f05b3c9 100644 --- a/backend/feed/migrations/0006_migrate_comments_to_communications.py +++ b/backend/feed/migrations/0006_migrate_comments_to_communications.py @@ -10,7 +10,8 @@ def migrate_comments_forward(apps, schema_editor): schema_editor.execute(""" INSERT INTO communications_chat ( type, name, created_by_id, can_reply, flags, - context_content_type_id, context_object_id + context_content_type_id, context_object_id, + created_at, is_main, is_blocked, include_all_users, extra_data ) SELECT DISTINCT 'comments', @@ -19,7 +20,12 @@ def migrate_comments_forward(apps, schema_editor): TRUE, '{"allow_replies": true, "allow_reactions": true, "allow_attachments": true, "allow_editing": true}'::jsonb, (SELECT id FROM django_content_type WHERE app_label='feed' AND model='post'), - c.post_id + c.post_id, + NOW(), + FALSE, + FALSE, + FALSE, + '{}'::jsonb FROM feed_comment c JOIN feed_post p ON p.id = c.post_id WHERE NOT EXISTS ( diff --git a/backend/requests_app/migrations/0010_migrate_comments_to_communications.py b/backend/requests_app/migrations/0010_migrate_comments_to_communications.py index 50092c57..367cdbf8 100644 --- a/backend/requests_app/migrations/0010_migrate_comments_to_communications.py +++ b/backend/requests_app/migrations/0010_migrate_comments_to_communications.py @@ -10,7 +10,8 @@ def migrate_comments_forward(apps, schema_editor): schema_editor.execute(""" INSERT INTO communications_chat ( type, name, created_by_id, can_reply, flags, - context_content_type_id, context_object_id + context_content_type_id, context_object_id, + created_at, is_main, is_blocked, include_all_users, extra_data ) SELECT DISTINCT 'comments', @@ -19,7 +20,12 @@ def migrate_comments_forward(apps, schema_editor): TRUE, '{"allow_replies": true, "allow_reactions": true, "allow_attachments": true, "allow_editing": true}'::jsonb, (SELECT id FROM django_content_type WHERE app_label='requests_app' AND model='request'), - rc.request_id + rc.request_id, + NOW(), + FALSE, + FALSE, + FALSE, + '{}'::jsonb FROM requests_app_requestcomment rc WHERE NOT EXISTS ( SELECT 1 FROM communications_chat cc