diff --git a/backend/feed/migrations/0006_migrate_comments_to_communications.py b/backend/feed/migrations/0006_migrate_comments_to_communications.py index 9d1c8b26..9d11e31b 100644 --- a/backend/feed/migrations/0006_migrate_comments_to_communications.py +++ b/backend/feed/migrations/0006_migrate_comments_to_communications.py @@ -15,9 +15,9 @@ def migrate_comments_forward(apps, schema_editor): SELECT DISTINCT 'comments', 'Комментарии: ' || substr(p.title, 1, 50), - NULL, - 1, - '{"allow_replies": true, "allow_reactions": true, "allow_attachments": true, "allow_editing": true}', + NULL::bigint, + 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 FROM feed_comment c @@ -43,10 +43,10 @@ def migrate_comments_forward(apps, schema_editor): c.author_id, c.text, c.created_at, - 0, - CASE WHEN (c.image != '' OR c.attachment != '') THEN 1 ELSE 0 END, - 0, 0, 0, 0, 0, - json_object( + FALSE, + CASE WHEN (c.image != '' OR c.attachment != '') THEN TRUE ELSE FALSE END, + FALSE, FALSE, FALSE, FALSE, FALSE, + jsonb_build_object( 'legacy_comment_id', c.id, 'legacy_model', 'feed.Comment' ) 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 b3a49e6a..50092c57 100644 --- a/backend/requests_app/migrations/0010_migrate_comments_to_communications.py +++ b/backend/requests_app/migrations/0010_migrate_comments_to_communications.py @@ -15,9 +15,9 @@ def migrate_comments_forward(apps, schema_editor): SELECT DISTINCT 'comments', 'Комментарии к заявке #' || rc.request_id, - NULL, - 1, - '{"allow_replies": true, "allow_reactions": true, "allow_attachments": true, "allow_editing": true}', + NULL::bigint, + 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 FROM requests_app_requestcomment rc @@ -42,8 +42,8 @@ def migrate_comments_forward(apps, schema_editor): rc.author_id, rc.text, rc.created_at, - 0, 0, 0, 0, 0, 0, 0, - json_object( + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + jsonb_build_object( 'legacy_comment_id', rc.id, 'legacy_model', 'requests_app.RequestComment' )