replace all functions after applying migrations
remove function definitions from migrations
Merge branch 'master' into xmpp