Adds before migrate hook.