Ensure (product, version) unique-- fix bug 980151

Add utils to deduplicate product versions
Add schema migration for unique constraint