tanishqgandhi1908 commented on code in PR #7789:
URL: https://github.com/apache/texera/pull/7789#discussion_r3826100090


##########
sql/updates/36.sql:
##########
@@ -80,22 +98,32 @@ BEGIN
                         op,
                         '{operatorProperties,fileName}',
                         CASE
-                            WHEN f.fn IS NOT NULL AND left(f.fn, 10) <> 
'/datasets/'
+                            WHEN f.fn ~ '^/datasets/'
+                             AND EXISTS (SELECT 1 FROM dataset d JOIN "user" u 
ON d.owner_uid = u.uid
+                                         WHERE u.email = 
split_part(ltrim(f.fn, '/'), '/', 2)
+                                           AND d.name  = 
split_part(ltrim(f.fn, '/'), '/', 3))
+                            THEN to_jsonb(regexp_replace(f.fn, '^/datasets/', 
'/dataset/'))

Review Comment:
   ChangeSet 36 is not in any released version: it's absent from release/v1.2, 
whose changelog tops out at id="1", and no tag contains it. So no release has a 
stored checksum to invalidate.
   
   That leaves developer machines and deployments tracking main, and you're 
right that clearing the checksum there would skip the normalization. Those are 
handled by running the file by hand:
   
   psql -h localhost -U postgres -f sql/updates/36.sql
   
   It's idempotent and covers all three shapes — unprefixed, plural-prefixed, 
and already-current — so it converges whatever state the database is in. Adding 
a post-38 changeSet was the original approach here; it was dropped in favour of 
correcting 36 in place, since the prefix it introduced has never shipped and two
   migrations describing one path format is worse to carry forward.
   
   Do you think we should introduce a new migration script for that? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to