File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
internal/database/migrations Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -131,13 +131,13 @@ WHERE value->>'status' IS NOT NULL
131131 AND value- >> ' status' NOT IN (' active' , ' deprecated' , ' deleted' );
132132
133133-- Remove duplicate name+version combinations
134- -- Keep the one with the highest version_id ( most recently added)
134+ -- Keep the one with the most recent publishedAt date
135135DELETE FROM servers s1
136136WHERE EXISTS (
137137 SELECT 1 FROM servers s2
138138 WHERE s2 .value - >> ' name' = s1 .value - >> ' name'
139139 AND s2 .value - >> ' version' = s1 .value - >> ' version'
140- AND s2 .version_id > s1 .version_id
140+ AND ( s2 .value - >> ' publishedAt ' ):: timestamp > ( s1 .value - >> ' publishedAt ' ):: timestamp
141141);
142142
143143-- Verify the operations completed as expected
You can’t perform that action at this time.
0 commit comments