A community based topic aggregation platform built on atproto
at main 1.5 kB view raw
1-- +goose Up 2-- Migration: Update comment URIs from social.coves.feed.comment to social.coves.community.comment 3-- This updates the namespace for all comment records in the database. 4-- Since we're pre-production, we're only updating the comments table (not votes). 5 6-- Update main comment URIs 7UPDATE comments 8SET uri = REPLACE(uri, '/social.coves.feed.comment/', '/social.coves.community.comment/') 9WHERE uri LIKE '%/social.coves.feed.comment/%'; 10 11-- Update root references (when root is a comment, not a post) 12UPDATE comments 13SET root_uri = REPLACE(root_uri, '/social.coves.feed.comment/', '/social.coves.community.comment/') 14WHERE root_uri LIKE '%/social.coves.feed.comment/%'; 15 16-- Update parent references (when parent is a comment) 17UPDATE comments 18SET parent_uri = REPLACE(parent_uri, '/social.coves.feed.comment/', '/social.coves.community.comment/') 19WHERE parent_uri LIKE '%/social.coves.feed.comment/%'; 20 21-- +goose Down 22-- Rollback: Revert comment URIs from social.coves.community.comment to social.coves.feed.comment 23 24UPDATE comments 25SET uri = REPLACE(uri, '/social.coves.community.comment/', '/social.coves.feed.comment/') 26WHERE uri LIKE '%/social.coves.community.comment/%'; 27 28UPDATE comments 29SET root_uri = REPLACE(root_uri, '/social.coves.community.comment/', '/social.coves.feed.comment/') 30WHERE root_uri LIKE '%/social.coves.community.comment/%'; 31 32UPDATE comments 33SET parent_uri = REPLACE(parent_uri, '/social.coves.community.comment/', '/social.coves.feed.comment/') 34WHERE parent_uri LIKE '%/social.coves.community.comment/%';