refactor sql patches following up pre deployment issues