фикс
This commit is contained in:
parent
66c243879f
commit
77551b5240
@ -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 (
|
||||
|
||||
@ -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 (
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user