Changed the CSW stuff to be a view instead of an ad hoc query.
View is created/replaced at runtime.
Upgraded the database migration plugin from 1.3.3 to 1.3.5