fix #970, #12317: adjust dbpatch table; delete map values with triggers

Fixes http://trac.openmicroscopy.org.uk/ome/ticket/970 and http://trac.openmicroscopy.org.uk/ome/ticket/12317. Broken tests not of this PR are fixed by @ximenesuk in https://github.com/openmicroscopy/openmicroscopy/pull/2892 and https://github.com/ome/scripts/pull/91.
--no-rebase

To test:

1. create a fresh DB
1. observe the contents of the `configuration` and `dbpatch` tables
1. start the server
1. see that a `DBEnumCheck` entry is added to both tables
1. check that the server is running okay
1. restart the server
1. see that both tables have nothing new from the restart
1. check that the server is running okay
1. import some images
1. see that we thus have some map property entries in the database, e.g., in the `uploadjob_versioninfo` table
1. delete some images
1. see that the corresponding property map entries are deleted.
Capitalise ``message``