Fix migration routine in deploy