diff --git a/internal/db/schema/migrations/oss/postgres/12/01_timestamp_sub_funcs.up.sql b/internal/db/schema/migrations/oss/postgres/12/01_timestamp_sub_funcs.up.sql index 9b49c403c..84c1ff1e3 100644 --- a/internal/db/schema/migrations/oss/postgres/12/01_timestamp_sub_funcs.up.sql +++ b/internal/db/schema/migrations/oss/postgres/12/01_timestamp_sub_funcs.up.sql @@ -1,5 +1,9 @@ begin; + -- The 'comment on function' statements below are not for the functions in the + -- file. They incorrectly override the comments for functions declared in + -- 7/01_functions.up.sql. Fixes are contained in 57/01_fix_comments.up.sql. + create function wt_sub_seconds(sec integer, ts timestamp with time zone) returns timestamp with time zone as $$ select ts - sec * '1 second'::interval; diff --git a/internal/db/schema/migrations/oss/postgres/57/01_fix_comments.up.sql b/internal/db/schema/migrations/oss/postgres/57/01_fix_comments.up.sql new file mode 100644 index 000000000..f9d48f067 --- /dev/null +++ b/internal/db/schema/migrations/oss/postgres/57/01_fix_comments.up.sql @@ -0,0 +1,12 @@ +begin; + + -- Restores the correct comments originally defined in 7/01_functions.up.sql + -- but incorrectly overridden in 12/01_timestamp_sub_funcs.up.sql. + comment on function wt_add_seconds is 'wt_add_seconds returns ts + sec.'; + comment on function wt_add_seconds_to_now is 'wt_add_seconds_to_now returns current_timestamp + sec.'; + + -- Sets comments for functions defined in 12/01_timestamp_sub_funcs.up.sql. + comment on function wt_sub_seconds is 'wt_sub_seconds returns ts - sec.'; + comment on function wt_sub_seconds_from_now is 'wt_sub_seconds_from_now returns current_timestamp - sec.'; + +commit; diff --git a/internal/db/schema/migrations/oss/postgres/7/01_functions.up.sql b/internal/db/schema/migrations/oss/postgres/7/01_functions.up.sql index 028e21183..910148954 100644 --- a/internal/db/schema/migrations/oss/postgres/7/01_functions.up.sql +++ b/internal/db/schema/migrations/oss/postgres/7/01_functions.up.sql @@ -1,5 +1,8 @@ begin; + -- Comments for the functions below were incorrectly overridden in + -- 12/01_timestamp_sub_funcs.up.sql but fixed in 57/01_fix_comments.up.sql. + create function wt_add_seconds(sec integer, ts timestamp with time zone) returns timestamp with time zone as $$ select ts + sec * '1 second'::interval;