Migrated schematron rules sets are not attached to syntax bindings after migration to v2.0.0
Relates to #372 (closed)
Solution:
I had to restore the schematronfile table from database backups. Good that we have daily backups!!
With that table restore the following query allowed to automatically fix this.
Query to fix
SELECT * FROM syntaxbinding;
SELECT * FROM schematronobject;
SELECT * FROM schematronfile;
SELECT * FROM xmlsyntaxschematronobject;
SELECT b.SyntaxBinding, spec.specName, v.versionId, so.SchematronObject, f.filePath
FROM syntaxbinding b -- every syntaxbinding
JOIN specversion v ON b.bindingFor = v.SpecVersion -- corresponding spec version
JOIN specification spec ON v.isVersionOf = spec.Specification -- corresponding spec
JOIN schematronfile s ON v.rootNode = s.Message -- schematron files for the root messages
JOIN schematronobject so ON s.SchematronFile = so.fileRef
JOIN fileobject f ON s.SchematronFile = f.FileObject;
INSERT INTO xmlsyntaxschematronobject (XmlSyntaxBinding, SchematronObject)
SELECT b.SyntaxBinding, so.SchematronObject
FROM syntaxbinding b
JOIN specversion v ON b.bindingFor = v.SpecVersion
JOIN specification spec ON v.isVersionOf = spec.Specification
JOIN schematronfile s ON v.rootNode = s.Message
JOIN fileobject f ON s.SchematronFile = f.FileObject
JOIN schematronobject so ON s.SchematronFile = so.fileRef;
SET SQL_SAFE_UPDATES=0;
UPDATE schematronobject so
JOIN fileobject f ON so.fileRef = f.FileObject
SET so.name = f.displayName;