patching custom sql adding CASCADE