diff --git a/backend/feed/migrations/0006_migrate_comments_to_communications.py b/backend/feed/migrations/0006_migrate_comments_to_communications.py index ba659420..3e112fc8 100644 --- a/backend/feed/migrations/0006_migrate_comments_to_communications.py +++ b/backend/feed/migrations/0006_migrate_comments_to_communications.py @@ -82,7 +82,7 @@ def migrate_comments_forward(apps, schema_editor): m.id, c.image, 'image', - substr(c.image, instr(c.image, '/') + 1), + substring(c.image from '[^/]*$'), 0, c.created_at FROM feed_comment c @@ -108,7 +108,7 @@ def migrate_comments_forward(apps, schema_editor): m.id, c.attachment, 'file', - substr(c.attachment, instr(c.attachment, '/') + 1), + substring(c.attachment from '[^/]*$'), 0, c.created_at FROM feed_comment c