add better SQL patch mechanism