[1.7.x] Used migration framework in GIS test tearDown

Backport of 48c4ea414 from master.
[1.7.x] Added Spatialite support to the new migration framework

Refs #22451.
Backport of 2ffa6ca73a from master.