reorganize sql patches