Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.

Commit 8e06edf

Browse files
committed
[BI-2109] - made migration safer
1 parent 6e53be5 commit 8e06edf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/resources/db/migration/V001.001__datasets_array.sql

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
-- Updates trial.additional_info to have a datasets array instead of just observationDatasetId.
1717
-- Leaves observationDatasetId in place out of an abundance of caution.
18+
-- Only updates rows that don't already have datasets key (just in case the code was updated prematurely).
1819
DO
1920
$$
2021
BEGIN
@@ -31,6 +32,8 @@ BEGIN
3132
'level', '0'
3233
)
3334
)
34-
);
35+
)
36+
WHERE
37+
additional_info->'datasets' IS NULL;
3538
END
3639
$$;

0 commit comments

Comments
 (0)