Shameless copying yet again from the sql-sync command.