Fix problem with old_versions field in Resource model
Fix problems with upgrades using the same version
Add a test to check upgrades with the same version