Fix SQL function creation for tests and scenarios
Merge pull request #419 from flibbertigibbet/feature/sql-function-move

Fix SQL function creation for tests and scenarios