Fix for GitHub issue 815: Migrator.UpdateDatabase fails when there are n...

...o migrations (and no database)

Added missing checks and unit test.