Incorrect version check for schema upgrade