Fix migration code in deploy