Change delete query to try to work with other databases