COOPR-617: Resource versioning

This PR also include changes for https://issues.cask.co/browse/COOPR-195. 
Put the ALTER TABLE and UPDATE statements in an if-block, so that only if providerType is missing version column do we add the version column and set all versions in the providerType rows to 1, and only if automatorType is missing version column .. and so on.