Functions should be replaced properly or deleted
The delete all and recreate afterwards approach does not work, since it deletes all dependencies.
If functions are deleted this should happen rather late to avoid errors by outdated dependencies on the function.