You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to be able to define my SQL functions in standalone files so that when I make changes to them they can be diffed against their previous versions. Currently I have to script dropping and recreating the function in a new migration, giving no easy way of seeing what the actual changes are via a diff.
If I could instead reference a function file in my migration I'd get the diff ability and the ability to have it automatically applied by the migration. (The hash for the migration should include hashing the contents of the referenced file.)
e.g. something like
9_ChangeMyFunc.sql:
-- Apply updated version of function
!include ./funcs/my_function.sql
Where funcs/my_function.sql contains:
drop function my_function(IN param number);
create function my_function(IN param number, IN param2 text)
as $BODY$
select param, param2
$BODY$;
The text was updated successfully, but these errors were encountered:
I'd like to be able to define my SQL functions in standalone files so that when I make changes to them they can be diffed against their previous versions. Currently I have to script dropping and recreating the function in a new migration, giving no easy way of seeing what the actual changes are via a diff.
If I could instead reference a function file in my migration I'd get the diff ability and the ability to have it automatically applied by the migration. (The hash for the migration should include hashing the contents of the referenced file.)
e.g. something like
9_ChangeMyFunc.sql:
Where funcs/my_function.sql contains:
The text was updated successfully, but these errors were encountered: