MODE-1853 - Reverted the changes to SchematicDB as per review and added a minor fix so that the code makes sense.